Skip to content

Commit

Permalink
🚸 Disable popup on add-ons domain for Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
richardfrost committed Jan 11, 2024
1 parent 05a2ef3 commit 5a5b8be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/script/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default class Page {
xpathNodeText: string;

static readonly disabledChromePages = ['chrome.google.com', 'chromewebstore.google.com'];
static readonly disabledFirefoxPages = ['addons.mozilla.org'];
static readonly disabledProtocols = new RegExp('(^chrome:|^about:|^[a-zA-Z]+-extension:)', 'i');
static readonly forbiddenNodeRegExp = new RegExp('^\s*(<[a-z].+?\/?>|{.+?:.+?;.*}|https?:\/\/[^\s]+$)');
static readonly forbiddenTags = ['SCRIPT', 'STYLE', 'INPUT', 'TEXTAREA', 'IFRAME', 'LINK'];
Expand Down
4 changes: 4 additions & 0 deletions src/script/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ export default class Popup {
this.Class.Config.BUILD.target == this.Class.Constants.BUILD_TARGET_CHROME
&& this.Class.Page.disabledChromePages.includes(this.domain.hostname)
)
|| (
this.Class.Config.BUILD.target == this.Class.Constants.BUILD_TARGET_FIREFOX
&& this.Class.Page.disabledFirefoxPages.includes(this.domain.hostname)
)
);
}

Expand Down

0 comments on commit 5a5b8be

Please sign in to comment.