diff options
author | Nick White <git@njw.me.uk> | 2011-12-12 18:24:47 +0000 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2011-12-12 18:24:47 +0000 |
commit | 0f69602bb5ee4552a04182dde0e0014c38bb69cf (patch) | |
tree | 08f3ef00ab1e73d7f863939a858e4922e485722c | |
parent | 09d374429159c989651f89b127bd7754f3c7202d (diff) |
Add options to gecko browsers
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | gecko/defaults/preferences/prefs.js | 2 | ||||
-rw-r--r-- | gecko/js.patch | 15 | ||||
-rw-r--r-- | gecko/options.xul | 5 |
5 files changed, 28 insertions, 5 deletions
@@ -79,10 +79,12 @@ dist: xpi: $(KEYFILE) rm -rf $(NAME)-$(VERSION).xpi gecko-build - mkdir -p gecko-build/chrome/content + mkdir -p gecko-build/chrome/content gecko-build/defaults/preferences sed 2q < COPYING > gecko-build/COPYING - cp gecko/chrome.manifest gecko-build/ + cp gecko/chrome.manifest gecko/options.xul gecko-build/ cp gecko/chrome/content/simplyread.xul gecko-build/chrome/content/ + cp gecko/defaults/preferences/prefs.js gecko-build/defaults/preferences/ + patch < gecko/js.patch > /dev/null cp simplyread.js gecko-build/chrome/content/ cat viable.js gecko/viablehook.js > gecko-build/chrome/content/viable.js rsvg -w 22 -h 22 icon.svg gecko-build/chrome/content/icon.png @@ -91,6 +93,7 @@ xpi: $(KEYFILE) < gecko/install.ttl | rapper -i turtle -o rdfxml /dev/stdin 2>/dev/null > gecko-build/install.rdf cd gecko-build; zip -r ../$(NAME)-$(VERSION).xpi . 1>/dev/null rm -rf gecko-build + patch -R < gecko/js.patch > /dev/null echo $(NAME)-$(VERSION).xpi crx: $(KEYFILE) @@ -20,8 +20,6 @@ chromium: see GenerateId in extension.cc of chrome for how it works gecko: - create option to turn off/on hyperlinks https://developer.mozilla.org/en/Adding_preferences_to_an_extension - create option to turn off/on css use straight rdf/xml to remove rapper build dependency use rapper and bourne shell script to sign this is difficult as mozilla wants the signature of a very particular serialisation of the update rdf @@ -43,9 +41,9 @@ gecko: - remove these two from all documents - remove listeners - remove any addon bar things + call simplyread() properly, rather than patching it with the preferences stuff add fennec support - https://wiki.mozilla.org/Mobile/Fennec/Extensions 'electrolysis' may require modifications - consider using plain rdfxml rather than turtle; conversion is a pain, and it's clear rdf is on its way out of gecko anyway test (currently outdated): current tests diff --git a/gecko/defaults/preferences/prefs.js b/gecko/defaults/preferences/prefs.js new file mode 100644 index 0000000..f58d378 --- /dev/null +++ b/gecko/defaults/preferences/prefs.js @@ -0,0 +1,2 @@ +pref("extensions.simplyread.nostyle", false); +pref("extensions.simplyread.nolinks", false); diff --git a/gecko/js.patch b/gecko/js.patch new file mode 100644 index 0000000..ddc8842 --- /dev/null +++ b/gecko/js.patch @@ -0,0 +1,15 @@ +--- simplyread.js 2011-12-12 14:13:05.017459673 +0000 ++++ simplyread.js.geckogross 2011-12-12 14:12:55.557462101 +0000 +@@ -4,6 +4,12 @@ if(window.content && window.content.docu + + function simplyread(nostyle, nolinks) + { ++ var prefs = Components.classes["@mozilla.org/preferences-service;1"] ++ .getService(Components.interfaces.nsIPrefService); ++ prefs = prefs.getBranch("extensions.simplyread."); ++ nostyle = prefs.getBoolPref("nostyle"); ++ nolinks = prefs.getBoolPref("nolinks"); ++ + /* count the number of <p> tags that are direct children of parenttag */ + function count_p(parenttag) + { diff --git a/gecko/options.xul b/gecko/options.xul new file mode 100644 index 0000000..3ef5d8d --- /dev/null +++ b/gecko/options.xul @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <setting type="bool" pref="extensions.simplyread.nostyle" title="Disable default style" /> + <setting type="bool" pref="extensions.simplyread.nolinks" title="Hide links" /> +</vbox> |