feat: Enhance Enterprise App Protection extension with monitoring and UI improvements
- Introduce error reporting and performance monitoring in background.js to track API calls and processing times. - Implement health check system to ensure the extension's operational status and log issues. - Add caching and encryption utilities in content.js for improved link analysis and data validation. - Refactor link analysis to process in batches, enhancing performance and user experience. - Update UI in domains_management.html and options.html for better usability and aesthetics, including responsive design and improved layout. - Enhance popup.html to display suspicious links with better styling and functionality. - Modify manifest.json to include new permissions and host access for Safe Browsing API.
This commit is contained in:
276
options.html
276
options.html
@@ -4,136 +4,262 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Enterprise App Protection - Settings</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f8f9fa;
|
||||
:root {
|
||||
--primary-color: #2563eb;
|
||||
--success-color: #059669;
|
||||
--background-color: #f8fafc;
|
||||
--surface-color: #ffffff;
|
||||
--text-primary: #1e293b;
|
||||
--text-secondary: #64748b;
|
||||
--border-color: #e2e8f0;
|
||||
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
||||
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
||||
--radius-sm: 0.375rem;
|
||||
--radius-md: 0.5rem;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
color: var(--text-primary);
|
||||
line-height: 1.5;
|
||||
min-height: 100vh;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 600px;
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
margin: 0 auto;
|
||||
background: var(--surface-color);
|
||||
padding: 2rem;
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
font-size: 1.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.settings-group {
|
||||
margin-bottom: 2rem;
|
||||
padding: 1.5rem;
|
||||
background-color: var(--background-color);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
color: #555;
|
||||
margin-top: 20px;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.75rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
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 */
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-primary);
|
||||
background-color: var(--surface-color);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
input:focus, textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
|
||||
}
|
||||
|
||||
input::placeholder, textarea::placeholder {
|
||||
color: var(--text-secondary);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
textarea {
|
||||
height: 120px;
|
||||
min-height: 100px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007bff;
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
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;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
border-radius: var(--radius-md);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.3s;
|
||||
transition: all 0.2s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
/* 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 */
|
||||
}
|
||||
button:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
background-color: var(--surface-color);
|
||||
color: var(--text-secondary);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.status-message {
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
margin-top: 1rem;
|
||||
border-radius: var(--radius-md);
|
||||
font-size: 0.875rem;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.status-message.success {
|
||||
background-color: #ecfdf5;
|
||||
color: var(--success-color);
|
||||
border: 1px solid #a7f3d0;
|
||||
}
|
||||
|
||||
.status-message.error {
|
||||
background-color: #fef2f2;
|
||||
color: #dc2626;
|
||||
border: 1px solid #fecaca;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Enterprise App Protection - Settings</h1>
|
||||
<div class="header">
|
||||
<h1>Enterprise App Protection</h1>
|
||||
<p>Configure your extension settings</p>
|
||||
</div>
|
||||
|
||||
<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" />
|
||||
<div class="settings-group">
|
||||
<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">
|
||||
Get your API key here
|
||||
</a>
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<label for="apiKey">API Key</label>
|
||||
<input type="text" id="apiKey" placeholder="Enter your API key" />
|
||||
<p class="help-text">Required for checking URLs against Google's Safe Browsing database</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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" />
|
||||
<div class="settings-group">
|
||||
<h3>🌐 Domains Database</h3>
|
||||
<p>Configure the source for your domains database</p>
|
||||
<div class="form-group">
|
||||
<label for="domainsDBURL">Database URL</label>
|
||||
<input type="text" id="domainsDBURL" placeholder="Enter the URL for your domains database"
|
||||
value="https://raw.githubusercontent.com/rrpbergsma/EnterpriseAppProtection/refs/heads/main/domains.json" />
|
||||
<p class="help-text">URL must point to a valid JSON file containing domain information</p>
|
||||
</div>
|
||||
|
||||
<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="form-group">
|
||||
<label for="updateInterval">Update Interval (hours)</label>
|
||||
<input type="number" id="updateInterval" placeholder="Enter update interval" value="24" min="1" max="168" />
|
||||
<p class="help-text">How often to check for updates to the domains database (1-168 hours)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
<h3>⚠️ Warning Messages</h3>
|
||||
<p>Customize how warnings are displayed to users</p>
|
||||
<div class="form-group">
|
||||
<label for="warningTemplate">Warning Message Template</label>
|
||||
<input type="text" id="warningTemplate"
|
||||
placeholder="Enter warning message template"
|
||||
value="Warning: This link claims to be {app} but goes to an unofficial domain." />
|
||||
<p class="help-text">Use {app} to represent the application name in your warning message</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="button-container">
|
||||
<button id="save">💾 Save Settings</button>
|
||||
<button id="save" class="save-btn">
|
||||
<span>💾</span>
|
||||
<span>Save Settings</span>
|
||||
</button>
|
||||
<button id="reset" class="reset-btn">
|
||||
<span>↺</span>
|
||||
<span>Reset to Defaults</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="statusMessage" class="status-message"></div>
|
||||
</div>
|
||||
|
||||
<script src="options.js"></script>
|
||||
|
Reference in New Issue
Block a user