Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 19, 2018
1 parent 4e1ba3b commit 9ce1f8a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,7 @@ var onMessage = function(request, sender, callback) {
break;

case 'writeHiddenSettings':
µb.hiddenSettings = µb.hiddenSettingsFromString(request.content);
µb.saveHiddenSettings();
µb.changeHiddenSettings(µb.hiddenSettingsFromString(request.content));
break;

default:
Expand Down
2 changes: 2 additions & 0 deletions src/js/redirect-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ RedirectEngine.prototype.resourcesFromString = function(text) {
}

warResolve();

this.modifyTime = Date.now();
};

/******************************************************************************/
Expand Down
15 changes: 15 additions & 0 deletions src/js/ublock.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,21 @@ var matchBucket = function(url, hostname, bucket, start) {

/******************************************************************************/

// https://www.reddit.com/r/uBlockOrigin/comments/8524cf/my_custom_scriptlets_doesnt_work_what_am_i_doing/

µBlock.changeHiddenSettings = function(hs) {
var mustReloadResources =
hs.userResourcesLocation !== this.hiddenSettings.userResourcesLocation;
this.hiddenSettings = hs;
this.saveHiddenSettings();
if ( mustReloadResources ) {
this.redirectEngine.invalidateResourcesSelfie();
this.loadRedirectResources();
}
};

/******************************************************************************/

µBlock.elementPickerExec = function(tabId, targetElement, zap) {
if ( vAPI.isBehindTheSceneTabId(tabId) ) {
return;
Expand Down

0 comments on commit 9ce1f8a

Please sign in to comment.