summaryrefslogtreecommitdiff
path: root/src/adblock.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2012-03-11 18:39:08 +0100
committerportix <portix@gmx.net>2012-03-11 18:39:08 +0100
commit68e21a64bad74cecff91d4933af85ffada4b79d1 (patch)
treef30e4f564600f81a3b9578e7dd6690de33554574 /src/adblock.c
parent90ac389ed134fc329c09ba8c508ef0de5d9dea1b (diff)
downloaddwb-68e21a64bad74cecff91d4933af85ffada4b79d1.zip
Execute the adblock element hider function as an anonymous function in subframes, fixes #123
Diffstat (limited to 'src/adblock.c')
-rw-r--r--src/adblock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/adblock.c b/src/adblock.c
index c39100f6..9eae2481 100644
--- a/src/adblock.c
+++ b/src/adblock.c
@@ -351,9 +351,9 @@ adblock_apply_element_hider(WebKitWebFrame *frame, GList *gl) {
}
}
char *script = g_strdup_printf(
- "var st=document.createElement('style');\
+ "(function() {var st=document.createElement('style');\
document.head.appendChild(st);\
- document.styleSheets[document.styleSheets.length-1].insertRule('%s', 0);",
+ document.styleSheets[document.styleSheets.length-1].insertRule('%s', 0);})();",
css_rule->str);
dwb_execute_script(frame, script, false);
g_free(script);