Skip to content

Commit

Permalink
Detects Remove It Permanently
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma committed Apr 8, 2014
1 parent cc06e62 commit e231625
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# adblock-detector.js

v0.0.1
v0.1.1

Copyright 2014 Nic Jansma

Expand All @@ -14,7 +14,8 @@ Licensed under the MIT license
browser such as [Adblock Plus](https://adblockplus.org/).

As of March 2014, this library is able to detect Google AdSense ads being blocked on Windows machines when
[Adblock Plus](https://adblockplus.org/) is installed for the following browsers:
[Adblock Plus](https://adblockplus.org/) or [Remove It Permanently](https://addons.mozilla.org/en-US/firefox/addon/remove-it-permanently/)
is installed for the following browsers:

* Internet Explorer 11
* Firefox 27
Expand Down Expand Up @@ -206,3 +207,4 @@ The tests are run manually. You should load the `test.html` in your browser of
## Version History
* v0.0.1 - 2014-03-22: Initial version
* v0.1.1 - 2014-04-08: Detects Remove It Permanently (Firefox addon)
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adblock-detector",
"version": "0.0.1",
"version": "0.1.1",
"homepage": "https://github.com/nicjansma/adblock-detector.js",
"authors": [
"Nic Jansma <nic@nicj.net>"
Expand Down
4 changes: 2 additions & 2 deletions dist/adblock-detector.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Adblock Detector",
"main": "./src/adblock-detector",
"author": "Nic Jansma",
"version": "0.1.0",
"version": "0.1.1",
"repository" : {
"type" : "git",
"url" : "http://github.com/nicjansma/adblock-detector.js.git"
Expand Down
14 changes: 10 additions & 4 deletions src/adblock-detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@

if (adWindow && adWindow.document) {
var adDoc = adWindow.document;

if ($(adDoc).find('iframe').length > 0 &&
$(adDoc).find('iframe')[0].className !== '') {
return true;
var adDocFrames = $(adDoc).find('iframe');

if (adDocFrames.length > 0) {
if (adDocFrames[0].className !== '') {
// AdBlock Plus
return true;
} else if (!adDocFrames.is(':visible')) {
// Remove It Permanently (Firefox)
return true;
}
}
}
} else {
Expand Down

0 comments on commit e231625

Please sign in to comment.