/** * Central management of HTTP(S) nonces * * Copyright (C) 2021 jahoti * Redistribution terms are gathered in the `copyright' file. */ /* * IMPORTS_START * IMPORT gen_nonce * IMPORTS_END */ var nonces = {}; function retrieve_nonce(tabId, frameId, update) { let code = tabId + '.' + frameId; console.log('Nonce for ' + code + ' ' + (update ? 'created/updated' : 'requested')); if (update) nonces[code] = gen_nonce(); return nonces[code]; } /* * EXPORTS_START * EXPORT retrieve_nonce * EXPORTS_END */