Skip to content

Commit 866e713

Browse files
committed
Make new containers copy the default policy
1 parent 08bd914 commit 866e713

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/bg/main.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,11 @@
6767
let contextStoreData = (await Storage.get("sync", "contextStore")).contextStore;
6868
if (contextStoreData) {
6969
ns.contextStore = new ContextStore(contextStoreData);
70-
await ns.contextStore.updateContainers();
70+
await ns.contextStore.updateContainers(ns.policy);
7171
} else {
72-
log("No container data found. Initializing new empty policies.")
73-
identities = await browser.contextualIdentities.query({});
74-
policies = new Object();
75-
identities.forEach(({cookieStoreId}) => {
76-
policies[cookieStoreId] = new Policy();
77-
})
78-
ns.contextStore = new ContextStore(({policies}));
79-
await ns.contextStore.updateContainers();
72+
log("No container data found. Initializing new policies.")
73+
ns.contextStore = new ContextStore();
74+
await ns.contextStore.updateContainers(ns.policy);
8075
await ns.saveContextStore();
8176
}
8277
}

src/nscl

src/ui/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var UI = (() => {
126126
},
127127

128128
async getPolicy(cookieStoreId) {
129-
await this.contextStore.updateContainers();
129+
await this.contextStore.updateContainers(this.policy);
130130
// debug("get policy", cookieStoreId, this.policy, this.contextStore);
131131
if (this.contextStore.policies.hasOwnProperty(cookieStoreId)) {
132132
let currentPolicy = this.contextStore.policies[cookieStoreId];

0 commit comments

Comments
 (0)