From 781514cfb946fb49bc1e2c52f16f808f26856f41 Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 1 Feb 2019 00:28:33 +0100 Subject: Graceful degradation for missing WebExtensions APIs on Chromium. --- src/bg/ChildPolicies.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/bg/ChildPolicies.js') diff --git a/src/bg/ChildPolicies.js b/src/bg/ChildPolicies.js index 74aeccb..5727762 100644 --- a/src/bg/ChildPolicies.js +++ b/src/bg/ChildPolicies.js @@ -51,6 +51,10 @@ } }; + if (!browser.contentScripts) { // #chromium fallback + Scripts.register = () => {}; + } + let flatten = arr => arr.reduce((a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []); let protocolRx = /^(\w+):/i; -- cgit v1.2.3