- Implement manifest.json for Chrome extension with necessary permissions and background scripts. - Create options.html for user settings including Google Safe Browsing API key, domains database URL, update interval, and warning message template. - Develop options.js to handle loading and saving settings using Chrome storage. - Design popup.html to display suspicious links and provide options to update the database and manage domains. - Implement popup.js to manage interactions in the popup, including updating the database and resetting the suspicious links counter. - Add testsite.html for dynamic testing of the extension with both official and fake links.
141 lines
4.1 KiB
HTML
141 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Enterprise App Protection - Settings</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
background-color: #f8f9fa;
|
|
margin: 0;
|
|
padding: 20px;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.container {
|
|
max-width: 600px;
|
|
width: 100%;
|
|
background: #fff;
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
h1 {
|
|
font-size: 24px;
|
|
color: #333;
|
|
text-align: center;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
h3 {
|
|
font-size: 18px;
|
|
color: #555;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
p {
|
|
font-size: 14px;
|
|
color: #666;
|
|
}
|
|
|
|
input, textarea {
|
|
width: 100%;
|
|
padding: 10px;
|
|
margin-top: 5px;
|
|
border: 1px solid #ccc;
|
|
border-radius: 5px;
|
|
font-size: 14px;
|
|
box-sizing: border-box; /* Ensures padding is included in width */
|
|
}
|
|
|
|
textarea {
|
|
height: 120px;
|
|
resize: vertical;
|
|
}
|
|
|
|
a {
|
|
color: #007bff;
|
|
text-decoration: none;
|
|
}
|
|
|
|
a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
pre {
|
|
background: #f4f4f4;
|
|
padding: 10px;
|
|
border-radius: 5px;
|
|
font-size: 14px;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.button-container {
|
|
text-align: center;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
button {
|
|
background-color: #007bff;
|
|
color: white;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
font-size: 16px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
transition: background 0.3s;
|
|
}
|
|
|
|
button:hover {
|
|
background-color: #0056b3;
|
|
}
|
|
/* Style the placeholder text to make it look distinct from user input */
|
|
input::placeholder, textarea::placeholder {
|
|
color: #aaa; /* Lighter gray color */
|
|
font-style: italic; /* Makes it look like a hint */
|
|
opacity: 1; /* Ensures it's fully visible */
|
|
}
|
|
|
|
/* Ensure actual input text is clear */
|
|
input, textarea {
|
|
color: #333; /* Dark text for actual input */
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Enterprise App Protection - Settings</h1>
|
|
|
|
<h3>🔑 Google Safe Browsing API Key</h3>
|
|
<p>
|
|
To use Google Safe Browsing, you need an API key.
|
|
<a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener noreferrer">
|
|
Click here to create a key
|
|
</a> (you may need to enable the Safe Browsing API in Google Cloud Console).
|
|
</p>
|
|
<input type="text" id="apiKey" placeholder="Enter your API key here" />
|
|
|
|
<h3>🌐 Domains Database URL</h3>
|
|
<p>Enter the URL for the domains database (JSON format):</p>
|
|
<input type="text" id="domainsDBURL" placeholder="Enter the URL here" value="https://raw.githubusercontent.com/rrpbergsma/EnterpriseAppProtection/refs/heads/main/domains.json" />
|
|
|
|
<h3>⏱️ Update Interval (hours)</h3>
|
|
<p>Enter the interval (in hours) to check for updates to the domains database:</p>
|
|
<input type="number" id="updateInterval" placeholder="Enter the update interval here" value="24" />
|
|
|
|
<h3>⚠️ Warning Message Template</h3>
|
|
<p>Enter the template for the warning message (use <code>{app}</code> to represent the application name):</p>
|
|
<input type="text" id="warningTemplate" placeholder="Enter the warning message template here" value="Warning: This link claims to be {app} but goes to an unofficial domain." />
|
|
|
|
|
|
<div class="button-container">
|
|
<button id="save">💾 Save Settings</button>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="options.js"></script>
|
|
</body>
|
|
</html> |