diff options
author | Wojtek Kosior <koszko@koszko.org> | 2021-07-06 18:27:38 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2021-07-06 18:27:38 +0200 |
commit | c86bdfcd9d56309faca69b58830cea1fa98870e0 (patch) | |
tree | aba830cbebf3a3a7a3af94c65103f14585651441 /content/page_actions.js | |
parent | 2059fab6c01a0793e8a82f80d9518ed2bd6d1e29 (diff) | |
parent | b7e2870ff58ef85370781aa04e9e0126988e39fd (diff) | |
download | browser-extension-c86bdfcd9d56309faca69b58830cea1fa98870e0.tar.gz browser-extension-c86bdfcd9d56309faca69b58830cea1fa98870e0.zip |
Merge popup display
Diffstat (limited to 'content/page_actions.js')
-rw-r--r-- | content/page_actions.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/content/page_actions.js b/content/page_actions.js index bc65449..fd405fe 100644 --- a/content/page_actions.js +++ b/content/page_actions.js @@ -9,6 +9,8 @@ * IMPORTS_START * IMPORT CONNECTION_TYPE * IMPORT browser + * IMPORT report_script + * IMPORT report_settings * IMPORTS_END */ @@ -19,15 +21,18 @@ var nonce; function handle_message(message) { - if (message.inject === undefined) - return; + const [action, data] = message; - for (let script_text of message.inject) { - if (loaded) - add_script(script_text); - else - scripts_awaiting.push(script_text); + if (action === "inject") { + for (let script_text of data) { + if (loaded) + add_script(script_text); + else + scripts_awaiting.push(script_text); + } } + if (action === "settings") + report_settings(data); } function document_loaded(event) @@ -46,6 +51,8 @@ function add_script(script_text) script.textContent = script_text; script.setAttribute("nonce", nonce); document.body.appendChild(script); + + report_script(script_text); } function handle_page_actions(script_nonce) { |