This commit is contained in:
gorhill 2017-09-12 11:43:43 -04:00
parent 3e6d365cb1
commit 5626b5005a
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 5 additions and 7 deletions

View File

@ -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');
};

View File

@ -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();
}
pageStore.temporarilyAllowLargeMediaElements(!details.state);
}
break;
}