Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://megogo.net/ru/view/1817491-krasotka-lyalya.html
- window.adBlock = false;
- (function (window) {
- var _dot = null;
- function createDot() {
- var dot = null;
- var dotClass = 'text-ad permads adplacement text-ads popexit adsonar ads-180x Ads_Billboard adService advertisement-icon';
- var dotStyle = 'position: absolute !important; top: -1000px !important; left: -10000px !important; width: 1px !important; height: 1px !important;';
- dot = document.createElement('div');
- dot.setAttribute('class', dotClass);
- dot.setAttribute('style', dotStyle);
- _dot = document.body.appendChild(dot);
- }
- function checkDot() {
- if (_dot === null) {
- createDot();
- }
- setTimeout(function () {
- if (document.body.getAttribute('abp') !== null
- || _dot.offsetParent === null
- || _dot.offsetHeight == 0
- || _dot.offsetLeft == 0
- || _dot.offsetTop == 0
- || _dot.offsetWidth == 0
- || _dot.clientHeight == 0
- || _dot.clientWidth == 0) {
- window.adBlock = true;
- }
- if (window.getComputedStyle !== undefined) {
- var dotTemp = window.getComputedStyle(_dot, null);
- if (dotTemp.getPropertyValue('display') == 'none'
- || dotTemp.getPropertyValue('visibility') == 'hidden') {
- window.adBlock = true;
- }
- }
- destroyDot();
- if (true == window.adBlock && (playerFrame = document.getElementById('playerFrame'))) {
- try {
- playerFrame.contentWindow.showAdBlockMessage();
- } catch (error) {}
- }
- }, 50);
- }
- function destroyDot() {
- document.body.removeChild(_dot);
- _dot = null;
- }
- if (window.addEventListener) {
- window.addEventListener('load', checkDot, false);
- } else {
- window.attachEvent('onload', checkDot);
- }
- })(window);
Advertisement
Add Comment
Please, Sign In to add comment