adblock-detect
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "adblock-detect", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Detect ad blocker presence in browser", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/dbrekalo/adblockdetect", |
{ | ||
"name": "adblock-detect", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Detect ad blocker presence in browser", | ||
@@ -18,6 +18,4 @@ "repository": { | ||
"build": "grunt build", | ||
"test": "mocha --reporter spec", | ||
"coverage": "istanbul cover _mocha -- -R spec", | ||
"coverageReport": "npm run coverage && open coverage/lcov-report/*.html", | ||
"coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", | ||
"test": "node ./node_modules/karma/bin/karma start --single-run --browsers PhantomJS", | ||
"coveralls": "cat ./coverage/lcov/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", | ||
"bump:patch": "grunt bump:patch", | ||
@@ -45,8 +43,16 @@ "bump:minor": "grunt bump:minor", | ||
"grunt-include-replace": "^5.0.0", | ||
"gulp": "^3.8.11", | ||
"istanbul": "^0.4.5", | ||
"jsdom": "^9.10.0", | ||
"jsdom-global": "^2.1.1", | ||
"istanbul-instrumenter-loader": "^1.2.0", | ||
"karma": "^1.4.1", | ||
"karma-coverage": "^1.1.1", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.2", | ||
"karma-spec-reporter": "0.0.26", | ||
"karma-webpack": "^2.0.2", | ||
"load-grunt-tasks": "^3.5.2", | ||
"mocha": "^3.2.0" | ||
"mocha": "^3.2.0", | ||
"mocha-loader": "^1.1.0", | ||
"webpack": "^1.14.0" | ||
} | ||
} |
var assert = require("chai").assert; | ||
var adblockDetect = require("../"); | ||
require('jsdom-global')(); | ||
var adblockerMock; | ||
var adblockerMockInterval; | ||
beforeEach(function() { | ||
function adblockerMock(implementationCallback, checksAfter) { | ||
adblockerMock = function(implementationCallback) { | ||
implementationCallback = implementationCallback || function(element) { | ||
element.style.display = 'none'; | ||
} | ||
implementationCallback = implementationCallback || function(element) { | ||
element.style.display = 'none'; | ||
adblockerMockInterval = setInterval(function() { | ||
var elements = window.document.getElementsByClassName('textAd'); | ||
if (elements.length > 0) {; | ||
implementationCallback(elements[0]); | ||
} | ||
}, checksAfter || 30); | ||
adblockerMockInterval = setInterval(function() { | ||
var elements = window.document.getElementsByClassName('textAd'); | ||
if (elements.length > 0) {; | ||
implementationCallback(elements[0]); | ||
} | ||
}, 30); | ||
}; | ||
}; | ||
}); | ||
afterEach(function() { | ||
@@ -51,5 +45,3 @@ | ||
adblockerMock(function(element) { | ||
element.offsetHeight = 0; | ||
}); | ||
adblockerMock(); | ||
@@ -67,3 +59,3 @@ adblockDetect(function(adblockDetected) { | ||
element.style.display = 'none'; | ||
}); | ||
}, 150); | ||
@@ -70,0 +62,0 @@ adblockDetect(function(adblockDetected) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30644
376
23