Revision dcfc78b0
Added by jahoti about 2 years ago
background/page_actions_server.js | ||
---|---|---|
11 | 11 |
* IMPORT TYPE_PREFIX |
12 | 12 |
* IMPORT CONNECTION_TYPE |
13 | 13 |
* IMPORT browser |
14 |
* IMPORT retrieve_nonce |
|
14 | 15 |
* IMPORT listen_for_connection |
15 | 16 |
* IMPORT sha256 |
16 | 17 |
* IMPORT get_query_best |
... | ... | |
137 | 138 |
function new_connection(port) |
138 | 139 |
{ |
139 | 140 |
console.log("new page actions connection!"); |
141 |
port.postMessage(['nonce', retrieve_nonce((port.sender.tab || '').id, port.sender.frameId)]); |
|
140 | 142 |
let handler = []; |
141 | 143 |
handler.push(m => handle_message(port, m, handler)); |
142 | 144 |
port.onMessage.addListener(handler[0]); |
Also available in: Unified diff
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.