From 9d825eaaa0715ee5244a09bc3d1968aa1664d048 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 26 Jan 2022 22:13:01 +0100 Subject: add new root content script --- common/misc.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'common') 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) { -- cgit v1.2.3