- only for VerSign domains var avglschecked = anchor.getAttribute("avglschecked"); if (avglschecked && avglschecked != 1) { var sPos = avglschecked.indexOf("S"); var hash = (sPos > -1) ? avglschecked.substring(0, sPos) : null; var split = (sPos > -1) ? avglschecked.substring(sPos+1) : null; if (hash && split && split != searchshield.VERISIGN_SPLIT_NOTEST) { // check updated verdict anchor for verisign domain var d = event.srcElement.ownerDocument; if (d.getElementById("LXPLSS_" + hash + "U" + searchshield.SCORE_SS_VERISIGN)) { searchshield.avgCallFunc(d, "RecordVSClick", hash, d.location.href); } } } var link = anchor.href; var verdict = searchshield.getAvgImage(anchor); var score = -1; var img_id = ''; if (verdict != null) { score = verdict.score; img_id = verdict.rawId; } // show popup alert (upper left) if ((score >= searchshield.SCORE_SS_CAUTION) && (score <= searchshield.SCORE_SS_WARNING)) { // prevent this click from going any further var search_hash = searchshield.avgCallFunc(document, 'GetHash', document.location.href); searchshield.ShowPopupAlert(document, link, img_id, search_hash); // if possible, stop the event from going any further searchshield.cancelEvent(event); return false; } return true;};// called by native to update phishing linkssearchshield.updatePhishingLinks = function (results){ if (!results) return; if (!xplSearch) return; var engine = xplSearch.engine; var resultParse = results.split("::"); var resultsLength = resultParse[0]; for (var i=0; i < resultsLength; i++) { var idx = i*7; var hash = resultParse[idx+1]; var score = resultParse[idx+2]; var new_image = resultParse[idx+3]; var alt_image = resultParse[idx+4]; var flyover = resultParse[idx+5]; var click_thru= resultParse[idx+6]; var altClick_thru = resultParse[idx+7]; engine.updateImage(hash, xplSearch.searchHash, score, new_image, alt_image, flyover, click_thru, altClick_thru); }};searchshield.getAvgImage = function (element){ var obj = {}; obj.img = xplSearch.engine.getImgElement(element); obj.score = -1; //parse the score from the id if (obj.img != null && obj.img.id) { var pos = !!obj.img.id ? obj.img.id.indexOf('U') + 1 : -1; obj.score = (pos < 1) ? -1 : obj.img.id.charAt(pos); obj.rawId = obj.img.id.substring(0,pos-1); } return obj;};searchshield.GetScannedLink = function (link){ if (!xplSearch || !(xplSearch.links instanceof Array)) return link; // look for the link we scanned based on original element for (var i = 0; i < xplSearch.links.length; i++) { if (xplSearch.links[i].element.href == link) return xplSearch.links[i].href; } // else return the incoming link return link;};searchshield.previouslyScanned = function (links, hash){ for (var i = 0; i < links.length; i++) { if ((links[i] != null) && (links[i].hash != null) && (links[i].hash == hash) && (links[i].checked == true)) return true; } return false;};searchshield.initPopupAlert = function (doc){ // check if it exists first if (doc.getElementById("XPLSS_PopupAlert")) return; // create a div to use for the popup itself, hide for now var popup_div = doc.createElement("DIV"); popup_div.setAttribute("id", "XPLSS_PopupAlert"); popup_div.style.position = "absolute"; popup_div.style.zIndex = "10000"; doc.body.appendChild(popup_div);};searchshield.initFlyover = function (doc, engine){ // create in top doc only if (doc !== window.top.document) doc = window.top.document; // check if it exists first if ((doc == null) || (doc.getElementById("XPLSS_Flyover"))) return; // create a div to use for the flyover itself, hide for now var flyover_div = doc.createElement("DIV"); flyover_div.setAttribute("id", "XPLSS_Flyover"); flyover_div.style.position = "absolute"; flyover_div.style.zIndex = "10000"; doc.body.appendChild(flyover_div); // create a layer for the image var trans_div = doc.createElement("DIV"); trans_div.setAttribute("id", "XPLSS_Trans"); trans_div.style.position = "absolute"; trans_div.style.zIndex = "9999"; doc.body.appendChild(trans_div);};searchshield.ShowPopupAlert = function (doc, link, hash, search){ // build the content var popup_content = searchshield.avgCallFunc(doc, 'BuildPopupAlert', hash, search); if (popup_content == null || popup_content == "") return; // get the div var div = doc.getElementById("XPLSS_PopupAlert");