(href.indexOf(findStr) != -1) { // first kind, locate real url findStr= "&q=http"; urlPos = href.indexOf(findStr); if (urlPos != -1) urlPos += 3; // puts it on the http } if (urlPos == -1) { findStr = "/pagead/iclk?sa="; if (href.indexOf(findStr) != -1) { // second kind, locate real url findStr = "&adurl=http"; urlPos = href.indexOf(findStr); if (urlPos != -1) urlPos += 7; // puts it on the http } } if (urlPos == -1) { if (href.indexOf("/aclk?sa=") != -1) { // third kind urlPos = href.indexOf("&q=http"); if (urlPos != -1) urlPos += 3; // puts it on the http else { urlPos = href.indexOf("&lp=http"); if (urlPos != -1) urlPos += 4; else { findStr = "&adurl=http"; urlPos = href.indexOf(findStr); if (urlPos != -1) urlPos += 7; // puts it on the http } } } } if (urlPos == -1) { if (href.indexOf("/url?cad=") != -1) { // fourth kind urlPos = href.indexOf("&q=http"); if (urlPos != -1) urlPos += 3; // puts it on the http } } if (urlPos != -1) { outHref = href.substring(urlPos); // extract any fragment text, shouldn't be unescaped var pound = outHref.indexOf("#"); if (pound != -1) { var fragment = outHref.substring(pound); outHref = outHref.substring(0, pound); outHref = unescape(outHref); outHref += fragment; if (searchshield.FilterUrl(outHref, this.filter_urls)) return false; return outHref; } outHref = unescape(outHref); if (outHref.indexOf("?") == -1) { var ampPos = outHref.indexOf("&"); if (ampPos != -1) outHref = outHref.substring(0, ampPos); } if (searchshield.FilterUrl(outHref, this.filter_urls)) return false; return outHref; } } // recommended link - use following to see one // http://www.google.cz/search?hl=cs&q=warey&btnG=Hledat&lr=lang_cs // elem parent class = r // href must contain - url? and q=http var parentNode = tag.parentNode; if (parentNode && (parentNode.className.toLowerCase() == "r")) { href = tag.href; if (href && (href.indexOf("/url?") != -1)) { // locate the real url var urlPos = href.indexOf("q=http"); if (urlPos != -1) { urlPos += 2; outHref = href.substring(urlPos); // include entire param up to '&' var ampPos = outHref.indexOf("&"); if (ampPos != -1) outHref = outHref.substring(0, ampPos); return outHref; } } } } // no link to self else if (tag.className && (tag.className.charAt(0) == "l" || tag.className == "sla")) { // check for any images on the link if (0 === tag.getElementsByTagName("IMG").length) return tag.href; } // else nothing return false;};/////////////// GOOGLE ////////////////////////////// AVG GOOGLE SEARCH ENGINE ///////////////searchshield.AVGGoogleSearchEngine = function(search){ searchshield.SearchEngine.call(this, search); this.onlyPrimaries = false;};searchshield.AVGGoogleSearchEngine.prototype = new searchshield.SearchEngine();searchshield.AVGGoogleSearchEngine.prototype.constructor = searchshield.AVGGoogleSearchEngine;searchshield.AVGGoogleSearchEngine.prototype.name = "avggoogle"; // the name by which the search engine is known (always lowercase)searchshield.AVGGoogleSearchEngine.prototype.validSearch = function(href) { var uri; if (typeof(this.search) === 'undefined' || null === this.search) uri = searchshield.parseLink(href); else uri = this.search.uri; if(!uri || !uri.host) return false; var domain = uri.host; // re stitch the uri path and query elements to // use existing logic var path = uri.path + uri.delimiter + uri.query; if (domain.indexOf("search.avg.com") > -1) { // ads link back to google return true; } return false;};searchshield.AVGGoogleSearchEngine.prototype.includeLink = function(tag){ var outHref = false; var findStr = ""; // check for interstitials if (searchshield.DoesURLContain(tag.href, "google.com")) { // link back to self - DIV elem GrandParent class of res1 or res3 is Sponsored Link var parentNode = tag.parentNode; if (parentNode)