From 0a68020771fc5b9dd437a90d5aac5e8a0c66719b Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 29 Dec 2023 00:01:11 -0500 Subject: Fix google docs (#473) * Add support for content script execution world * Update manifest version to support world parameter in Chromium browsers * Update google docs injection * Reuse code for registration * Add info --- ext/js/background/script-manager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/js/background') diff --git a/ext/js/background/script-manager.js b/ext/js/background/script-manager.js index 1142121f..353c50e3 100644 --- a/ext/js/background/script-manager.js +++ b/ext/js/background/script-manager.js @@ -129,7 +129,7 @@ export async function unregisterContentScript(id) { * @returns {chrome.scripting.RegisteredContentScript} */ function createContentScriptRegistrationOptions(details, id) { - const {css, js, allFrames, matches, runAt} = details; + const {css, js, allFrames, matches, runAt, world} = details; /** @type {chrome.scripting.RegisteredContentScript} */ const options = { id: id, @@ -150,5 +150,8 @@ function createContentScriptRegistrationOptions(details, id) { if (typeof runAt !== 'undefined') { options.runAt = runAt; } + if (typeof world !== 'undefined') { + options.world = world; + } return options; } -- cgit v1.2.3