= new searchshield.SearchEngine();searchshield.GoogleSearchEngine.prototype.constructor = searchshield.GoogleSearchEngine;searchshield.GoogleSearchEngine.prototype.name = "google"; // the name by which the search engine is known (always lowercase)searchshield.GoogleSearchEngine.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 hostMatch = 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; // For Google the host must match: // .google.com OR // .google.com.XX OR // .google.co.XX OR // .google.XX where XX is a country code // one special case is www.googe.off.ai (Anguilla) // Where any subdomain can come before the top level domain if ( /(\.(?:google|mozilla)\.(?:com|(?:co|off)\.[a-z]{2}|[a-z]{2}))/i.test(domain) ) { //check the path if ((path.indexOf("search?") == 0) || (path.indexOf("sponsoredlinks?") == 0) || (path.indexOf("webhp?") == 0) || (path.indexOf("webhp#") == 0) || (path.indexOf("#q=") == 0) || (path.indexOf("#hl=") == 0) || (path.indexOf("#sclient=") == 0)) { return true; } } return false;};searchshield.GoogleSearchEngine.prototype.includeLink = function(tag){ var href = ""; var outHref = false; var findStr = ""; // check for interstitials if (searchshield.DoesURLContain(tag.href, this.search.uri.host)) { findStr = this.search.uri.host + "/interstitial?"; if (tag.className == "l" && tag.href) { if (tag.href.indexOf(findStr) != -1) { findStr = "?url="; var pos = tag.href.indexOf(findStr); if (pos !== -1) { pos += 5; outHref = tag.href.substring(pos); if (searchshield.FilterUrl(outHref, this.filter_urls)) return false; return outHref; } } } if (tag.className == "sla") { findStr = "/url?q="; urlPos = tag.href.indexOf(findStr); if (urlPos != -1) { urlPos += 7; outHref = tag.href.substring(urlPos); return outHref; } } // if an ad id if ((tag.id.indexOf("pa") == 0) || (tag.id.indexOf("an") == 0) || (tag.className == "resultLink")) { var urlPos = -1; // ads now need unescaping href = unescape(tag.href); findStr= "/url?sa="; if (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); // the destination url is in the href string of this redirector if (outHref.indexOf('xg4ken.com') > -1) { urlPos = (unescape(outHref)).indexOf('url[]=') + 6; var destUrl = (unescape(outHref)).substring(urlPos); if (searchshield.FilterUrl(destUrl, this.filter_urls)) { var destUrl = searchshield.getHrefFromCiteElement(tag); if (destUrl) return searchshield.checkUrl(searchshield.removeHtmlTags(destUrl)); return false; } return destUrl; } // filtered url but can get destination from href