diff --git a/src/js/pagestore.js b/src/js/pagestore.js index ea3a42816..429d8bd91 100644 --- a/src/js/pagestore.js +++ b/src/js/pagestore.js @@ -485,10 +485,10 @@ PageStore.prototype.injectLargeMediaElementScriptlet = function() { µb.contextMenu.update(this.tabId); }; -PageStore.prototype.temporarilyAllowLargeMediaElements = function() { +PageStore.prototype.temporarilyAllowLargeMediaElements = function(state) { this.largeMediaCount = 0; µb.contextMenu.update(this.tabId); - this.allowLargeMediaElementsUntil = Date.now() + 86400000; + this.allowLargeMediaElementsUntil = state ? Date.now() + 86400000 : 0; µb.scriptlets.injectDeep(this.tabId, 'load-large-media-all'); }; diff --git a/src/js/ublock.js b/src/js/ublock.js index 924802da7..5ad8e8861 100644 --- a/src/js/ublock.js +++ b/src/js/ublock.js @@ -493,11 +493,9 @@ var reInvalidHostname = /[^a-z0-9.\-\[\]:]/, ); break; case 'no-large-media': - if ( details.state === false ) { - var pageStore = this.pageStoreFromTabId(details.tabId); - if ( pageStore !== null ) { - pageStore.temporarilyAllowLargeMediaElements(); - } + var pageStore = this.pageStoreFromTabId(details.tabId); + if ( pageStore !== null ) { + pageStore.temporarilyAllowLargeMediaElements(!details.state); } break; }