mirror of https://github.com/gorhill/uBlock.git
fix #2946
This commit is contained in:
parent
3e6d365cb1
commit
5626b5005a
|
@ -485,10 +485,10 @@ PageStore.prototype.injectLargeMediaElementScriptlet = function() {
|
||||||
µb.contextMenu.update(this.tabId);
|
µb.contextMenu.update(this.tabId);
|
||||||
};
|
};
|
||||||
|
|
||||||
PageStore.prototype.temporarilyAllowLargeMediaElements = function() {
|
PageStore.prototype.temporarilyAllowLargeMediaElements = function(state) {
|
||||||
this.largeMediaCount = 0;
|
this.largeMediaCount = 0;
|
||||||
µb.contextMenu.update(this.tabId);
|
µ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');
|
µb.scriptlets.injectDeep(this.tabId, 'load-large-media-all');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -493,11 +493,9 @@ var reInvalidHostname = /[^a-z0-9.\-\[\]:]/,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'no-large-media':
|
case 'no-large-media':
|
||||||
if ( details.state === false ) {
|
|
||||||
var pageStore = this.pageStoreFromTabId(details.tabId);
|
var pageStore = this.pageStoreFromTabId(details.tabId);
|
||||||
if ( pageStore !== null ) {
|
if ( pageStore !== null ) {
|
||||||
pageStore.temporarilyAllowLargeMediaElements();
|
pageStore.temporarilyAllowLargeMediaElements(!details.state);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue