feat: disable until configured + auto permission request for custom domains
Interception is now completely inactive until the user configures at least one identity field or explicit mapping. Before that: - Icon shows gray (unconfigured) - No fetch/XHR hooks fire - First-run banner tells user to set up Custom domains: clicking "Add Domain" in Options now triggers the browser's native permission prompt via permissions.request(). No more manual chrome://extensions site access step. Icon states are now: - Gray = unconfigured (nothing will happen) - Black = active and protecting - Blue = reveal mode on - Red = manually disabled https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
This commit is contained in:
+10
-2
@@ -446,12 +446,20 @@
|
||||
// ============================================================
|
||||
// Check if we have anything to substitute
|
||||
// ============================================================
|
||||
function hasSubstitutions() {
|
||||
// Check if the user has configured anything at all.
|
||||
// If not, the extension is effectively disabled — no interception.
|
||||
function isConfigured() {
|
||||
return mappings.length > 0 ||
|
||||
(identity.emails || []).length > 0 ||
|
||||
(identity.names || []).length > 0 ||
|
||||
(identity.usernames || []).length > 0 ||
|
||||
(identity.phones || []).length > 0;
|
||||
(identity.hostnames || []).length > 0 ||
|
||||
(identity.phones || []).length > 0 ||
|
||||
!!identity.catchAllEmail;
|
||||
}
|
||||
|
||||
function hasSubstitutions() {
|
||||
return isConfigured();
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user