From dcfc78b0d175bee7b3b7e273282078d50bd4ca09 Mon Sep 17 00:00:00 2001 From: jahoti Date: Mon, 12 Jul 2021 00:00:00 +0000 Subject: Stop using the nonce consistently for a URL Nonces are now randomly generated, either in the page (for non-HTTP(S) pages) or by a background module which stores them by tab and frame IDs. In order to support the increased variance in nonce-generating methods and allow them to be loaded from the background, handle_page_actions is now invoked separately according to (non-)blocking mechanism. --- background/page_actions_server.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'background/page_actions_server.js') diff --git a/background/page_actions_server.js b/background/page_actions_server.js index 2d9c333..d92b870 100644 --- a/background/page_actions_server.js +++ b/background/page_actions_server.js @@ -11,6 +11,7 @@ * IMPORT TYPE_PREFIX * IMPORT CONNECTION_TYPE * IMPORT browser + * IMPORT retrieve_nonce * IMPORT listen_for_connection * IMPORT sha256 * IMPORT get_query_best @@ -137,6 +138,7 @@ function handle_message(port, message, handler) function new_connection(port) { console.log("new page actions connection!"); + port.postMessage(['nonce', retrieve_nonce((port.sender.tab || '').id, port.sender.frameId)]); let handler = []; handler.push(m => handle_message(port, m, handler)); port.onMessage.addListener(handler[0]); -- cgit v1.2.3