summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-01-26 22:13:01 +0100
committerWojtek Kosior <koszko@koszko.org>2022-01-26 22:13:01 +0100
commit9d825eaaa0715ee5244a09bc3d1968aa1664d048 (patch)
treef75d9306339b65e15750489e9c383cdb51212aaf /common
parent42fe44050661ed59198fb166672bfdaa119d4333 (diff)
downloadbrowser-extension-9d825eaaa0715ee5244a09bc3d1968aa1664d048.tar.gz
browser-extension-9d825eaaa0715ee5244a09bc3d1968aa1664d048.zip
add new root content script
Diffstat (limited to 'common')
-rw-r--r--common/misc.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/misc.js b/common/misc.js
index ed8f400..f8e0812 100644
--- a/common/misc.js
+++ b/common/misc.js
@@ -96,9 +96,12 @@ function open_in_settings(prefix, name)
* Check if url corresponds to a browser's special page (or a directory index in
* case of `file://' protocol).
*/
-const privileged_reg =
- /^(chrome(-extension)?|moz-extension):\/\/|^about:|^file:\/\/.*\/$/;
-#EXPORT url => privileged_reg.test(url) AS is_privileged_url
+#IF MOZILLA
+const priv_reg = /^moz-extension:\/\/|^about:|^file:\/\/[^?#]*\/([?#]|$)/;
+#ELIF CHROMIUM
+const priv_reg = /^chrome(-extension)?:\/\/|^about:|^file:\/\/[^?#]*\/([?#]|$)/;
+#ENDIF
+#EXPORT url => priv_reg.test(url) AS is_privileged_url
/* Parse a CSP header */
function parse_csp(csp) {