diff --git a/extensions/adblock.c b/extensions/adblock.c index 46ca3087..6abeeb1e 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -636,6 +636,36 @@ adblock_is_matched (const gchar* opts, return adblock_is_matched_by_pattern (req_uri, page_uri); } +static gchar* +adblock_prepare_urihider_js (const gchar* uri) +{ + const char *js = + "(function() {" + "function getElementsByAttribute (strTagName, strAttributeName, strAttributeValue) {" + " var arrElements = document.getElementsByTagName (strTagName);" + " var arrReturnElements = new Array();" + " for (var i=0; i 0 && strAttributeValue.indexOf (oAttribute) != -1)" + " arrReturnElements.push (oCurrent);" + " }" + " return arrReturnElements;" + "}" + "function hideElementBySrc (strUri) {" + " var oElements = getElementsByAttribute('img', 'src', strUri);" + " if (oElements.length == 0)" + " oElements = getElementsByAttribute ('iframe', 'src', strUri);" + " for (var i=0; i