summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md33
-rw-r--r--chrome/README.md33
-rw-r--r--chrome/free_haaretz.css (renamed from free_haaretz.css)0
-rw-r--r--chrome/free_haaretz.js (renamed from free_haaretz.js)0
-rw-r--r--chrome/manifest.json (renamed from manifest.json)0
-rw-r--r--firefox/README.md28
-rw-r--r--firefox/data/free_haaretz.css6
-rw-r--r--firefox/doc/main.md0
-rw-r--r--firefox/free-haaretz.xpibin0 -> 7298 bytes
-rw-r--r--firefox/lib/main.js33
-rw-r--r--firefox/package.json13
-rw-r--r--firefox/test/test-main.js12
12 files changed, 125 insertions, 33 deletions
diff --git a/README.md b/README.md
index c6c7c07..e69de29 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +0,0 @@
-# Free Haaretz
-
-A nefarious Chrome 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 [Firefox version](https://github.com/yuvadm/free-haaretz-ff)?)
-
-## Install
-
-This extension can't be installed via the Google App Store since I couldn't care less about paying $5.00 and registering to work with it.
-
-You can follow these steps to install manually:
-
- 1. Download the [extension ZIP file](https://github.com/yuvadm/free-haaretz/archive/master.zip), also located on the right side bar.
-
- 2. Unzip the file.
-
- 3. In Google Chrome (or Chromium), in the address bar go to [chrome://extensions](chrome://extensions)
-
- 4. In the top right corner, click to enable **Developer Mode**.
-
- 5. Click the **Load unpacked extension** button.
-
- 6. Navigate to the folder you unziped your code to, and select it.
-
- 7. The **FreeHaaretz** extension should now be loaded
-
-## 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/chrome/README.md b/chrome/README.md
new file mode 100644
index 0000000..c6c7c07
--- /dev/null
+++ b/chrome/README.md
@@ -0,0 +1,33 @@
+# Free Haaretz
+
+A nefarious Chrome 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 [Firefox version](https://github.com/yuvadm/free-haaretz-ff)?)
+
+## Install
+
+This extension can't be installed via the Google App Store since I couldn't care less about paying $5.00 and registering to work with it.
+
+You can follow these steps to install manually:
+
+ 1. Download the [extension ZIP file](https://github.com/yuvadm/free-haaretz/archive/master.zip), also located on the right side bar.
+
+ 2. Unzip the file.
+
+ 3. In Google Chrome (or Chromium), in the address bar go to [chrome://extensions](chrome://extensions)
+
+ 4. In the top right corner, click to enable **Developer Mode**.
+
+ 5. Click the **Load unpacked extension** button.
+
+ 6. Navigate to the folder you unziped your code to, and select it.
+
+ 7. The **FreeHaaretz** extension should now be loaded
+
+## 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/free_haaretz.css b/chrome/free_haaretz.css
index 2329aa5..2329aa5 100644
--- a/free_haaretz.css
+++ b/chrome/free_haaretz.css
diff --git a/free_haaretz.js b/chrome/free_haaretz.js
index bce3207..bce3207 100644
--- a/free_haaretz.js
+++ b/chrome/free_haaretz.js
diff --git a/manifest.json b/chrome/manifest.json
index 6af4816..6af4816 100644
--- a/manifest.json
+++ b/chrome/manifest.json
diff --git a/firefox/README.md b/firefox/README.md
new file mode 100644
index 0000000..f8953d2
--- /dev/null
+++ b/firefox/README.md
@@ -0,0 +1,28 @@
+# Free Haaretz (Firefox Edition)
+
+A nefarious Firefox add-on that easily bypasses the Haaretz paywall.
+
+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 [add-on XPI file](https://github.com/yuvadm/free-haaretz-ff/raw/master/free-haaretz.xpi)
+
+ 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`
+
+
+## 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/firefox/data/free_haaretz.css b/firefox/data/free_haaretz.css
new file mode 100644
index 0000000..a2ffe9d
--- /dev/null
+++ b/firefox/data/free_haaretz.css
@@ -0,0 +1,6 @@
+section#header-reading-list {
+ display: none;
+}
+section#header-user-menu {
+ display: none;
+}
diff --git a/firefox/doc/main.md b/firefox/doc/main.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/firefox/doc/main.md
diff --git a/firefox/free-haaretz.xpi b/firefox/free-haaretz.xpi
new file mode 100644
index 0000000..cf67f4b
--- /dev/null
+++ b/firefox/free-haaretz.xpi
Binary files differ
diff --git a/firefox/lib/main.js b/firefox/lib/main.js
new file mode 100644
index 0000000..cd47a05
--- /dev/null
+++ b/firefox/lib/main.js
@@ -0,0 +1,33 @@
+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) {
+ 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);
+ channel.originalURI.path = channel.originalURI.path.split('?')[0];
+ }
+ 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);
+ }
+ }
+ }
+};
+
+var observerService = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService);
+observerService.addObserver(observer, 'http-on-modify-request', false);
diff --git a/firefox/package.json b/firefox/package.json
new file mode 100644
index 0000000..dc773f9
--- /dev/null
+++ b/firefox/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "free-haaretz",
+ "title": "Free Haaretz",
+ "description": "A nefarious extension that easily bypasses the Haaretz paywall",
+ "author": "Yuval Adam",
+ "license": "Public Domain",
+ "version": "0.7.1",
+ "main": "lib/main",
+ "engines": {
+ "firefox": ">=38.0a1",
+ "fennec": ">=38.0a1"
+ }
+}
diff --git a/firefox/test/test-main.js b/firefox/test/test-main.js
new file mode 100644
index 0000000..147f98a
--- /dev/null
+++ b/firefox/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);