Add declarationBlock parameter to createStyleSheet()
Background
See https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/issues/608 for background.
At the moment the createStyleSheet()
function returns a style sheet containing the CSS code {display: none !important;}
. For the purpose of debugging, we'll need an additional parameter that specifies the code to use in the style sheet.
What to change
Add a new optional declarationBlock
parameter to createStyleSheet()
in lib/elemHide.js
. It should be a string
whose value represents a CSS declaration block. The returned style sheet should use this code instead of the default {display: none !important;}
.
Hints for testes
Make sure basic element hiding is working.
For example, add the filters ###foo
and example.com##.bar
and see that the first and second <div>
s in the following HTML are hidden if the content is loaded from example.com:
<!DOCTYPE html>
<html>
<body>
<div id="foo">#foo</div>
<div class="bar">.bar</div>
<div>Other</div>
</body>
</html>
If the content is loaded from example.net or some other domain instead, only the first <div>
should be hidden.
/cc @snoack