Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit 6c75ccd

Browse files
committed
regression: fixed persistence
1 parent 2dbd739 commit 6c75ccd

File tree

3 files changed

+20
-24
lines changed

3 files changed

+20
-24
lines changed

js/httpsb.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ HTTPSB.createPermanentGlobalScope = function(url) {
131131
if ( this.removePermanentScopeFromScopeKey(scopeKey) ) {
132132
changed = true;
133133
}
134-
if ( changed ) {
135-
this.savePermissions();
136-
}
137134
return changed;
138135
};
139136

@@ -167,16 +164,11 @@ HTTPSB.createPermanentDomainScope = function(url) {
167164
this.permanentScopes.scopes[scopeKey] = scope;
168165
changed = true;
169166
}
170-
171167
// Remove potentially existing site scope: it would occlude domain scope.
172168
scopeKey = this.siteScopeKeyFromURL(url);
173169
if ( this.removePermanentScopeFromScopeKey(scopeKey) ) {
174170
changed = true;
175171
}
176-
177-
if ( changed ) {
178-
this.savePermissions();
179-
}
180172
return changed;
181173
};
182174

@@ -206,7 +198,6 @@ HTTPSB.createPermanentSiteScope = function(url) {
206198
scope = new PermissionScope();
207199
scope.whitelist('main_frame', '*');
208200
this.permanentScopes.scopes[scopeKey] = scope;
209-
this.savePermissions();
210201
return true;
211202
};
212203

js/popup.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,15 +1336,19 @@ function updatePersistButton() {
13361336

13371337
function persistScope() {
13381338
var httpsb = getHTTPSB();
1339-
var rulset = getTemporaryRuleset();
1340-
if ( httpsb.isGlobalScopeKey(rulset.tScopeKey) ) {
1341-
httpsb.createPermanentGlobalScope(HTTPSBPopup.pageURL);
1342-
} else if ( httpsb.isDomainScopeKey(rulset.tScopeKey) ) {
1343-
httpsb.createPermanentDomainScope(HTTPSBPopup.pageURL);
1344-
} else if ( httpsb.isSiteScopeKey(rulset.tScopeKey) ) {
1345-
httpsb.createPermanentSiteScope(HTTPSBPopup.pageURL);
1346-
}
1347-
httpsb.applyRulesetPermanently(rulset.tScopeKey, rulset);
1339+
var ruleset = getTemporaryRuleset();
1340+
var changed = false;
1341+
if ( httpsb.isGlobalScopeKey(ruleset.tScopeKey) ) {
1342+
changed = httpsb.createPermanentGlobalScope(HTTPSBPopup.pageURL);
1343+
} else if ( httpsb.isDomainScopeKey(ruleset.tScopeKey) ) {
1344+
changed = httpsb.createPermanentDomainScope(HTTPSBPopup.pageURL);
1345+
} else if ( httpsb.isSiteScopeKey(ruleset.tScopeKey) ) {
1346+
changed = httpsb.createPermanentSiteScope(HTTPSBPopup.pageURL);
1347+
}
1348+
changed = httpsb.applyRulesetPermanently(ruleset.tScopeKey, ruleset) || changed;
1349+
if ( changed ) {
1350+
httpsb.savePermissions();
1351+
}
13481352
updateMatrixStats();
13491353
updateMatrixColors();
13501354
updateMatrixBehavior();
@@ -1358,16 +1362,16 @@ function persistScope() {
13581362

13591363
function revertScope() {
13601364
var httpsb = getHTTPSB();
1361-
var rulset = getTemporaryRuleset();
1362-
httpsb.revertScopeRules(rulset.tScopeKey);
1363-
if ( httpsb.isGlobalScopeKey(rulset.pScopeKey) ) {
1365+
var ruleset = getTemporaryRuleset();
1366+
httpsb.revertScopeRules(ruleset.tScopeKey);
1367+
if ( httpsb.isGlobalScopeKey(ruleset.pScopeKey) ) {
13641368
httpsb.createTemporaryGlobalScope(HTTPSBPopup.pageURL);
1365-
} else if ( httpsb.isDomainScopeKey(rulset.pScopeKey) ) {
1369+
} else if ( httpsb.isDomainScopeKey(ruleset.pScopeKey) ) {
13661370
httpsb.createTemporaryDomainScope(HTTPSBPopup.pageURL);
1367-
} else if ( httpsb.isSiteScopeKey(rulset.pScopeKey) ) {
1371+
} else if ( httpsb.isSiteScopeKey(ruleset.pScopeKey) ) {
13681372
httpsb.createTemporarySiteScope(HTTPSBPopup.pageURL);
13691373
}
1370-
httpsb.revertScopeRules(rulset.pScopeKey);
1374+
httpsb.revertScopeRules(ruleset.pScopeKey);
13711375
updateMatrixStats();
13721376
updateMatrixColors();
13731377
updateMatrixBehavior();

js/storage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ HTTPSB.loadScopedRules = function() {
8585
httpsb.createTemporaryScopeFromScopeKey(httpsb.behindTheSceneScopeKey);
8686
httpsb.whitelistTemporarily(httpsb.behindTheSceneScopeKey, '*', '*');
8787
httpsb.toggleTemporaryMtxFiltering(httpsb.behindTheSceneScopeKey, false);
88+
httpsb.toggleTemporaryABPFiltering(httpsb.behindTheSceneScopeKey, false);
8889
}
8990

9091
// rhill 2013-09-23: ok, there is no point in blacklisting

0 commit comments

Comments
 (0)