联系我们
电话:
邮箱:
地址:
020-85270165
hantongb@126.com
广州市天河区黄埔大道西平云路163号广电平云广场A塔7层
行业动态
广州市住房和城乡建设委员会关于召开广州市2018年建筑施工“安全生产月”观摩会暨建筑工地扬尘治理现场
作者:本站编辑 时间:2018-6-11 14:09:17 点击: 关闭 复制 打印
(e) {} } return newElement; }; document.createElement = function () { var newElement = originalCreateElementFn.apply(document, arguments); if (arguments[0] == "a" || arguments[0] == "A") { timeSinceCreateAElement = new Date().getTime(); var originalDispatchEventFn = newElement.dispatchEvent; newElement.dispatchEvent = function (event) { if (event.type != null && ('' + event.type).toLocaleLowerCase() == "click") { if (!isInWhitelist(newElement.href)) { window.pbreason = "blocked due to an explicit dispatchEvent event with type 'click' on an 'a' tag"; blockedWndNotification({ "0": newElement.href }); return true; } } return originalDispatchEventFn.call(this, event); }; lastCreatedAElement = newElement; } return newElement; }; ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// // Block artificial mouse click on frashly created elements ///////////////////////////////////////////////////////////////////////////////// document.createEvent = function () { try { if (arguments[0].toLowerCase().includes("mouse") && new Date().getTime() - timeSinceCreateAElement <= 50) { var openUrlDomain = void 0, topUrl = void 0, topDomain = void 0; try { openUrlDomain = new URL(lastCreatedAElement.href).hostname; } catch (e) {} try { topUrl = window.location != window.parent.location ? document.referrer : document.location.href; } catch (e) {} try { topDomain = new URL(topUrl).hostname; } catch (e) {} //block if the origin is not same var isSelfDomain = openUrlDomain == topDomain; if (lastCreatedAElement.href.trim() && !isInWhitelist(lastCreatedAElement.href) && !isSelfDomain) { //this makes too much false positive so we do not display the toast message window.pbreason = 'Blocked because \'a\' element was recently created and ' + arguments[0] + ' event was created shortly after'; arguments[0] = lastCreatedAElement.href; blockedWndNotification({ "0": lastCreatedAElement.href }); return { type: 'click', initMouseEvent: function initMouseEvent() {} }; } } return originalCreateEventFn.apply(document, arguments); } catch (err) {} }; ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// // Monitor full screen requests ///////////////////////////////////////////////////////////////////////////////// function onFullScreen(isInFullScreenMode) { if (isInFullScreenMode) { fullScreenOpenTime = new Date().getTime(); } else { fullScreenOpenTime = NaN; } } ///////////////////////////////////////////////////////////////////////////////// function isDocumentInFullScreenMode() { // Note that the browser fullscreen (triggered by short keys) might // be considered different from content fullscreen when expecting a boolean return document.fullScreenElement && document.fullScreenElement !== null || // alternative standard methods document.mozFullscreenElement != null || document.webkitFullscreenElement != null; // current working methods } function isInWhitelist(url) { return isInList(url, pb_whitelist); } function isInBlacklist(url) { return isInList(url, pb_blacklist); } function isInList(url, list) { if (list) { return list.some(function (li) { return new RegExp("https?://(www\.|.*\.)?" + li + "+").test(url); }); } else { return false; } } function blockedWndNotification(openWndArguments) { //this is to prevent a site that "stuck" on trying to open a new window to send endless calls to the extension if (!lastBlockTime || lastBlockTime < Date.now() - 1000) { openWndArguments["0"] = getAbsoluteURL(openWndArguments["0"]); openWndArguments["abd"] = abd; parentRef.postMessage({ type: "blockedWindow", args: JSON.stringify(openWndArguments) }, parentOrigin); } lastBlockTime = Date.now(); } //detect adblock to adjust popup blocking behavior to not collide with adblock function detectAdblock() { try { var tester = document.createElement('div'); tester.innerHTML = ' '; tester.className = 'adsbox'; tester.style.cssText = "position:absolute;top-1000px;left:-1000px;"; docum

1 2 3 4 5 6

 
Copyright @2011   汉通控股集团有限公司版权所有   京ICP备56880909号
电话:020-85270165    传真:020-85270165