aboutsummaryrefslogtreecommitdiff
path: root/background
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-09-10 16:50:56 +0200
committerWojtek Kosior <koszko@koszko.org>2021-09-10 16:50:56 +0200
commit5c75d7446187a01409eff1a1e5946f66267f61fb (patch)
treebbb6b86d0f404fce68b8f70cafacb8b4eaee35be /background
parent72cbfa74f7f30fdf60fc6ad73182ed1cca3d3712 (diff)
downloadbrowser-extension-5c75d7446187a01409eff1a1e5946f66267f61fb.tar.gz
browser-extension-5c75d7446187a01409eff1a1e5946f66267f61fb.zip
Make it impossible to check "Allow native scripts" for pages with payload.
Diffstat (limited to 'background')
-rw-r--r--background/page_actions_server.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/background/page_actions_server.js b/background/page_actions_server.js
index b0db5f5..e21ca6e 100644
--- a/background/page_actions_server.js
+++ b/background/page_actions_server.js
@@ -25,15 +25,19 @@ let policy_observable;
function send_actions(url, port)
{
- let [pattern, settings] = query_best(storage, url);
- if (!settings)
- settings = {allow: policy_observable && policy_observable.value};
+ const [pattern, queried_settings] = query_best(storage, url);
+
+ const settings = {allow: policy_observable && policy_observable.value};
+ Object.assign(settings, queried_settings);
+ if (settings.components)
+ settings.allow = false;
+
const repos = storage.get_all(TYPE_PREFIX.REPO);
port.postMessage(["settings", [pattern, settings, repos]]);
- let components = settings.components;
- let processed_bags = new Set();
+ const components = settings.components;
+ const processed_bags = new Set();
if (components !== undefined)
send_scripts([components], port, processed_bags);