1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-29 06:07:11 +02:00

Fixes 1357

This commit is contained in:
Chris 2015-05-05 20:20:36 -06:00
parent 0d529677c4
commit a9e77b4d48
2 changed files with 9 additions and 1 deletions

View File

@ -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.

View File

@ -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;