mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Ping back after the port opening to the background script now also returns the settings and the persistentRnd data.
This commit is contained in:
parent
e5e38e148e
commit
a4a92fc2f9
2 changed files with 27 additions and 2 deletions
21
lib/frame.js
21
lib/frame.js
|
@ -7,9 +7,11 @@
|
|||
|
||||
const {intercept} = require("./intercept.js");
|
||||
const {ask} = require("./askForPermission.js");
|
||||
const lists = require("./lists.js");
|
||||
const {check: originalCheck, checkStack: originalCheckStack} = require("./check.js");
|
||||
|
||||
const {error, warning, message, notice, verbose, setPrefix: setLogPrefix} = require("./logging");
|
||||
const logging = require("./logging");
|
||||
const {error, warning, message, notice, verbose, setPrefix: setLogPrefix} = logging;
|
||||
setLogPrefix("frame script");
|
||||
|
||||
// Variable to "unload" the script
|
||||
|
@ -49,6 +51,23 @@
|
|||
notice("my tab id is", data.tabId);
|
||||
tabId = data.tabId;
|
||||
}
|
||||
if (data.hasOwnProperty("persistentRnd")){
|
||||
notice("got persistent random data", data.persistentRnd);
|
||||
const {persistent: persistentRnd} = require("./randomSupplies.js");
|
||||
Object.keys(data.persistentRnd).forEach(function(domain){
|
||||
verbose("random data for", domain, data.persistentRnd[domain]);
|
||||
persistentRnd.setDomainRnd(domain, data.persistentRnd[domain]);
|
||||
});
|
||||
}
|
||||
if (settings.isStillDefault && data.hasOwnProperty("settings")){
|
||||
notice("got settings from background script");
|
||||
Object.keys(data.settings).forEach(function(key){
|
||||
settings[key] = data.settings[key];
|
||||
});
|
||||
settings.isStillDefault = false;
|
||||
logging.clearQueue();
|
||||
lists.updateAll();
|
||||
}
|
||||
});
|
||||
var notifications = [];
|
||||
function notify(data){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue