diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-01-26 22:13:01 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-01-26 22:13:01 +0100 |
commit | 9d825eaaa0715ee5244a09bc3d1968aa1664d048 (patch) | |
tree | f75d9306339b65e15750489e9c383cdb51212aaf /common | |
parent | 42fe44050661ed59198fb166672bfdaa119d4333 (diff) | |
download | browser-extension-9d825eaaa0715ee5244a09bc3d1968aa1664d048.tar.gz browser-extension-9d825eaaa0715ee5244a09bc3d1968aa1664d048.zip |
add new root content script
Diffstat (limited to 'common')
-rw-r--r-- | common/misc.js | 9 |
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) { |