mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-16 23:42:39 +01:00
Fixes 1357
This commit is contained in:
parent
0d529677c4
commit
a9e77b4d48
@ -193,6 +193,15 @@ var uBlockCollapser = (function() {
|
||||
hostname: window.location.hostname,
|
||||
selectors: selectors
|
||||
});
|
||||
var selectorStr = selectors.join(',\n'),
|
||||
style = document.createElement('style');
|
||||
// The linefeed before the style block is very important: do no remove!
|
||||
style.appendChild(document.createTextNode(selectorStr + '\n{display:none !important;}'));
|
||||
var parent = document.body || document.documentElement;
|
||||
if ( parent ) {
|
||||
parent.appendChild(style);
|
||||
vAPI.styles.push(style);
|
||||
}
|
||||
}
|
||||
// Renew map: I believe that even if all properties are deleted, an
|
||||
// object will still use more memory than a brand new one.
|
||||
|
@ -94,7 +94,6 @@ var cosmeticFilters = function(details) {
|
||||
var text = hide.join(',\n');
|
||||
hideElements(text);
|
||||
var style = vAPI.specificHideStyle = document.createElement('style');
|
||||
// The linefeed before the style block is very important: do not remove!
|
||||
style.appendChild(document.createTextNode(text + '\n{display:none !important;}'));
|
||||
//console.debug('µBlock> "%s" cosmetic filters: injecting %d CSS rules:', details.domain, details.hide.length, hideStyleText);
|
||||
var parent = document.head || document.documentElement;
|
||||
|
Loading…
Reference in New Issue
Block a user