From 10ced96cb445e21e4d9e6d29420f194e6a0041e5 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 14 Jan 2014 01:44:24 +0200 Subject: Initial project files --- README.md | 20 ++++++++++++++++++++ doc/main.md | 0 lib/main.js | 0 package.json | 9 +++++++++ test/test-main.js | 12 ++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 README.md create mode 100644 doc/main.md create mode 100644 lib/main.js create mode 100644 package.json create mode 100644 test/test-main.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..178edef --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# Free Haaretz (Firefox Edition) + +A nefarious Firefox extension that easily bypasses the Haaretz paywall. + +If things aren't working as expected, make sure to reinstall (update) the extension from time to time, to make sure you have the latest code. + + +## Install + + 1. Download the [extension ZIP file](https://github.com/yuvadm/free-haaretz-ff/archive/master.zip), also located on the right side bar. + + 2. Unzip the file. + + 3. ??? + +## License + +This code is in the Public Domain, do whatever you want with it, I'm not responsible. + +![Public Domain](https://i.creativecommons.org/p/mark/1.0/88x31.png) diff --git a/doc/main.md b/doc/main.md new file mode 100644 index 0000000..e69de29 diff --git a/lib/main.js b/lib/main.js new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..03578c9 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "fffree-haaretz", + "title": "fffree-haaretz", + "id": "jid1-QL2xtvfKt4r4kA", + "description": "a basic add-on", + "author": "", + "license": "MPL 2.0", + "version": "0.1" +} diff --git a/test/test-main.js b/test/test-main.js new file mode 100644 index 0000000..147f98a --- /dev/null +++ b/test/test-main.js @@ -0,0 +1,12 @@ +var main = require("./main"); + +exports["test main"] = function(assert) { + assert.pass("Unit test running!"); +}; + +exports["test main async"] = function(assert, done) { + assert.pass("async Unit test running!"); + done(); +}; + +require("sdk/test").run(exports); -- cgit v1.3.1 From a3fdb328f89acec265356b2d483d3bce1a4824ad Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 14 Jan 2014 02:05:48 +0200 Subject: Modify User-Agent for Haaretz URLs --- lib/main.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/main.js b/lib/main.js index e69de29..62cd41e 100644 --- a/lib/main.js +++ b/lib/main.js @@ -0,0 +1,15 @@ +var {Cc, Ci} = require('chrome'); + +var observer = { + observe: function(subject, topic, data) { + if (topic == 'http-on-modify-request') { + var channel = subject.QueryInterface(Ci.nsIHttpChannel); + if (/haaretz\.co(m|\.il)/.test(channel.originalURI.host)) { + channel.setRequestHeader('User-Agent', 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)', false); + } + } + } +}; + +var observerService = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService); +observerService.addObserver(observer, 'http-on-modify-request', false); -- cgit v1.3.1 From 95de2fe7574aefb5ff2ea750f29b894ca63affb1 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 14 Jan 2014 02:24:01 +0200 Subject: Block stupid bots script --- lib/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/main.js b/lib/main.js index 62cd41e..65da8cf 100644 --- a/lib/main.js +++ b/lib/main.js @@ -7,6 +7,9 @@ var observer = { if (/haaretz\.co(m|\.il)/.test(channel.originalURI.host)) { channel.setRequestHeader('User-Agent', 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)', false); } + if (/\/htz\/js\/bots\.js/.test(channel.originalURI.path)) { + channel.redirectTo(Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService).newURI('http://were.on/a/road/to/nowhere', null, null)); + } } } }; -- cgit v1.3.1 From fc9b554393527b5e9d846d0a1e258f40889b11a0 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 14 Jan 2014 02:26:22 +0200 Subject: Add link back to Chrome version --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 178edef..811099b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ A nefarious Firefox extension that easily bypasses the Haaretz paywall. If things aren't working as expected, make sure to reinstall (update) the extension from time to time, to make sure you have the latest code. +(Looking for the [Chrome version](https://github.com/yuvadm/free-haaretz)?) ## Install -- cgit v1.3.1 From 3bfbcafc5bf7a86b19a066c310d4c706b7b4c707 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 14 Jan 2014 02:40:17 +0200 Subject: Release version 0.1 XPI --- free-haaretz.xpi | Bin 0 -> 7800 bytes package.json | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 free-haaretz.xpi diff --git a/free-haaretz.xpi b/free-haaretz.xpi new file mode 100644 index 0000000..1b6ad7a Binary files /dev/null and b/free-haaretz.xpi differ diff --git a/package.json b/package.json index 03578c9..8075c74 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "fffree-haaretz", - "title": "fffree-haaretz", + "name": "free-haaretz", + "title": "Free Haaretz", "id": "jid1-QL2xtvfKt4r4kA", - "description": "a basic add-on", - "author": "", - "license": "MPL 2.0", + "description": "A nefarious extension that easily bypasses the Haaretz paywall", + "author": "Yuval Adam", + "license": "Public Domain", "version": "0.1" } -- cgit v1.3.1 From c1aff5b57b35fd094cb34e96fb9de3f33e35302b Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 14 Jan 2014 02:45:57 +0200 Subject: Add installation instructions --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 811099b..4a67fe8 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,18 @@ If things aren't working as expected, make sure to reinstall (update) the extens ## Install - 1. Download the [extension ZIP file](https://github.com/yuvadm/free-haaretz-ff/archive/master.zip), also located on the right side bar. + 1. Download the [extension XPI file](https://github.com/yuvadm/free-haaretz-ff/raw/master/free-haaretz.xpi) - 2. Unzip the file. + 2. Go to the `Tools > Add-ons` menu + + 3. Click the ⚙ button on the top + + 4. Choose `Install Add-on From File` + + 5. Select the XPI file you downloaded + + 6. Click `Install Now` - 3. ??? ## License -- cgit v1.3.1 From ae31b2216615d703ed60f377cdf9403e3f4fd043 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 14 Jan 2014 02:50:37 +0200 Subject: Its an add-on, not an extension --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4a67fe8..f8953d2 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # Free Haaretz (Firefox Edition) -A nefarious Firefox extension that easily bypasses the Haaretz paywall. +A nefarious Firefox add-on that easily bypasses the Haaretz paywall. -If things aren't working as expected, make sure to reinstall (update) the extension from time to time, to make sure you have the latest code. +If things aren't working as expected, make sure to reinstall (update) the add-on from time to time, to make sure you have the latest code. (Looking for the [Chrome version](https://github.com/yuvadm/free-haaretz)?) ## Install - 1. Download the [extension XPI file](https://github.com/yuvadm/free-haaretz-ff/raw/master/free-haaretz.xpi) + 1. Download the [add-on XPI file](https://github.com/yuvadm/free-haaretz-ff/raw/master/free-haaretz.xpi) 2. Go to the `Tools > Add-ons` menu -- cgit v1.3.1 From 4cd9a7e3bf32aaef6e31be3b2c3b015256787507 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Thu, 23 Jan 2014 17:50:22 +0100 Subject: Replace bot script redirect with request cancel Fixes annoying redirect hanging --- free-haaretz.xpi | Bin 7800 -> 7777 bytes lib/main.js | 4 ++-- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index 1b6ad7a..91a68f9 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ diff --git a/lib/main.js b/lib/main.js index 65da8cf..dcd661c 100644 --- a/lib/main.js +++ b/lib/main.js @@ -1,4 +1,4 @@ -var {Cc, Ci} = require('chrome'); +var {Cc, Ci, Cr} = require('chrome'); var observer = { observe: function(subject, topic, data) { @@ -8,7 +8,7 @@ var observer = { channel.setRequestHeader('User-Agent', 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)', false); } if (/\/htz\/js\/bots\.js/.test(channel.originalURI.path)) { - channel.redirectTo(Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService).newURI('http://were.on/a/road/to/nowhere', null, null)); + subject.cancel(Cr.NS_BINDING_ABORTED); } } } diff --git a/package.json b/package.json index 8075c74..814189a 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,5 @@ "description": "A nefarious extension that easily bypasses the Haaretz paywall", "author": "Yuval Adam", "license": "Public Domain", - "version": "0.1" + "version": "0.2" } -- cgit v1.3.1 From 11fa4033906aa46f0a78af748137cd13a97874e9 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sun, 13 Jul 2014 15:14:09 +0300 Subject: Add query params removal from URIs --- free-haaretz.xpi | Bin 7777 -> 7803 bytes lib/main.js | 1 + package.json | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index 91a68f9..cec184c 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ diff --git a/lib/main.js b/lib/main.js index dcd661c..31ea47d 100644 --- a/lib/main.js +++ b/lib/main.js @@ -6,6 +6,7 @@ var observer = { var channel = subject.QueryInterface(Ci.nsIHttpChannel); if (/haaretz\.co(m|\.il)/.test(channel.originalURI.host)) { channel.setRequestHeader('User-Agent', 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)', false); + channel.originalURI.path = channel.originalURI.path.split('?')[0]; } if (/\/htz\/js\/bots\.js/.test(channel.originalURI.path)) { subject.cancel(Cr.NS_BINDING_ABORTED); diff --git a/package.json b/package.json index 814189a..902878d 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,5 @@ "description": "A nefarious extension that easily bypasses the Haaretz paywall", "author": "Yuval Adam", "license": "Public Domain", - "version": "0.2" + "version": "0.3" } -- cgit v1.3.1 From e345f4dd364d1d364371fe63dc14ed607be9b309 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 18 Jul 2014 01:58:06 +0300 Subject: Package XPI for Firefox Mobile as well --- free-haaretz.xpi | Bin 7803 -> 7858 bytes package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index cec184c..c1d3bf3 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ diff --git a/package.json b/package.json index 902878d..b7b2e65 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,5 @@ "description": "A nefarious extension that easily bypasses the Haaretz paywall", "author": "Yuval Adam", "license": "Public Domain", - "version": "0.3" + "version": "0.3.1" } -- cgit v1.3.1 From f0c60cb4eab491e546c128a5da544d00cc8da3d4 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 24 Mar 2015 11:30:04 +0200 Subject: Block reading list headers --- data/free_haaretz.css | 6 ++++++ free-haaretz.xpi | Bin 7858 -> 8280 bytes lib/main.js | 8 ++++++++ package.json | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 data/free_haaretz.css diff --git a/data/free_haaretz.css b/data/free_haaretz.css new file mode 100644 index 0000000..a2ffe9d --- /dev/null +++ b/data/free_haaretz.css @@ -0,0 +1,6 @@ +section#header-reading-list { + display: none; +} +section#header-user-menu { + display: none; +} diff --git a/free-haaretz.xpi b/free-haaretz.xpi index c1d3bf3..e2d79de 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ diff --git a/lib/main.js b/lib/main.js index 31ea47d..796202c 100644 --- a/lib/main.js +++ b/lib/main.js @@ -1,4 +1,12 @@ var {Cc, Ci, Cr} = require('chrome'); +var data = require("sdk/self").data; +var pageMod = require("sdk/page-mod"); + +pageMod.PageMod({ + include: "*.haaretz.co.il", + contentStyleFile: data.url('free_haaretz.css') +}); + var observer = { observe: function(subject, topic, data) { diff --git a/package.json b/package.json index b7b2e65..4c88933 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,5 @@ "description": "A nefarious extension that easily bypasses the Haaretz paywall", "author": "Yuval Adam", "license": "Public Domain", - "version": "0.3.1" + "version": "0.4" } -- cgit v1.3.1 From f420e3ab02aa7c9f00ef3c247956a3ec6694845f Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 24 Mar 2015 14:27:09 +0200 Subject: Build XPI for mobile as well --- free-haaretz.xpi | Bin 8280 -> 8333 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index e2d79de..5f543a9 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ -- cgit v1.3.1 From a2321e650aa0645fc909250766ca6b435cc4c78c Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sun, 8 Nov 2015 16:29:24 +0200 Subject: Bump to v0.5 and jpm --- free-haaretz.xpi | Bin 8333 -> 2940 bytes package.json | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index 5f543a9..9b1d636 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ diff --git a/package.json b/package.json index 4c88933..423bdfe 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "free-haaretz", "title": "Free Haaretz", - "id": "jid1-QL2xtvfKt4r4kA", "description": "A nefarious extension that easily bypasses the Haaretz paywall", "author": "Yuval Adam", "license": "Public Domain", - "version": "0.4" + "version": "0.5", + "main": "lib/main" } -- cgit v1.3.1 From fe34e622fbd15fc3e643b7fe6dcfa58980615adb Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sun, 8 Nov 2015 16:33:29 +0200 Subject: Override with signed XPI --- free-haaretz.xpi | Bin 2940 -> 7179 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index 9b1d636..bb2f276 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ -- cgit v1.3.1 From 8d58ecd90a9544414395def58836f7dadcab6f59 Mon Sep 17 00:00:00 2001 From: inbar Date: Fri, 22 Jan 2016 22:34:21 +0100 Subject: Add supported engines to package.json. Fennec is the code name for FF for Android. (https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#engines) --- package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 423bdfe..1dd32ce 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,9 @@ "author": "Yuval Adam", "license": "Public Domain", "version": "0.5", - "main": "lib/main" + "main": "lib/main", + "engines": { + "firefox": ">=38.0a1", + "fennec": ">=38.0a1" + } } -- cgit v1.3.1 From ce204f451db02ad37fd8d0cab15f0d65288a8a90 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sat, 23 Jan 2016 12:30:52 +0200 Subject: Bump to v0.6 with latest commit and update XPI --- free-haaretz.xpi | Bin 7179 -> 13370308 bytes package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index bb2f276..956f223 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ diff --git a/package.json b/package.json index 1dd32ce..2f973bd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A nefarious extension that easily bypasses the Haaretz paywall", "author": "Yuval Adam", "license": "Public Domain", - "version": "0.5", + "version": "0.6", "main": "lib/main", "engines": { "firefox": ">=38.0a1", -- cgit v1.3.1 From f73938cb83c06c411fa018214b9b11a3365b0e64 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Tue, 15 Mar 2016 00:35:42 +0200 Subject: Block adblock block (we have to go deeper) --- free-haaretz.xpi | Bin 13370308 -> 7298 bytes lib/main.js | 6 ++++++ package.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/free-haaretz.xpi b/free-haaretz.xpi index 956f223..cf67f4b 100644 Binary files a/free-haaretz.xpi and b/free-haaretz.xpi differ diff --git a/lib/main.js b/lib/main.js index 796202c..cd47a05 100644 --- a/lib/main.js +++ b/lib/main.js @@ -19,6 +19,12 @@ var observer = { if (/\/htz\/js\/bots\.js/.test(channel.originalURI.path)) { subject.cancel(Cr.NS_BINDING_ABORTED); } + if (/\/htz\/js\/resp\/header_scripts\/internal\/util\/z_adblockutil\.js/.test(channel.originalURI.path)) { + subject.cancel(Cr.NS_BINDING_ABORTED); + } + if (/\/htz\/js\/resp\/body_scripts\/internal\/plugins\/adblock\.js/.test(channel.originalURI.path)) { + subject.cancel(Cr.NS_BINDING_ABORTED); + } } } }; diff --git a/package.json b/package.json index 2f973bd..dc773f9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A nefarious extension that easily bypasses the Haaretz paywall", "author": "Yuval Adam", "license": "Public Domain", - "version": "0.6", + "version": "0.7.1", "main": "lib/main", "engines": { "firefox": ">=38.0a1", -- cgit v1.3.1