diff options
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) { |