From 575c45e066404a85adbf8112f676ba89c7258daa Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 23 Jun 2011 19:30:51 +0100 Subject: Add viable to firefox, improve firefox usage, general cleanups --- Makefile | 4 +++- TODO | 1 - chromium/updates.xml | 2 +- chromium/viable.js | 9 --------- chromium/viablehook.js | 1 + gecko/chrome/content/simplyread.xul | 9 +++++---- gecko/install.ttl | 4 ++-- gecko/viablehook.js | 5 +++++ viable.js | 8 ++++++++ 9 files changed, 25 insertions(+), 18 deletions(-) delete mode 100755 chromium/viable.js create mode 100755 chromium/viablehook.js create mode 100644 gecko/viablehook.js create mode 100755 viable.js diff --git a/Makefile b/Makefile index 46a0b83..b420f02 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,7 @@ xpi: $(KEYFILE) cp gecko/chrome.manifest gecko-build/ cp gecko/chrome/content/simplyread.xul gecko-build/chrome/content/ 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 rsvg -w 64 -h 64 icon.svg gecko-build/icon.png sed -e "s/VERSION/$(VERSION)/g" -e "s|WEBSITE|$(WEBSITE)|g" -e "s|GECKOID|$(GECKOID)|g" -e "s/PUBKEY/`sh gecko/genpub.sh $(KEYFILE)`/g" \ @@ -95,7 +96,8 @@ crx: $(KEYFILE) rm -rf chromium-build mkdir chromium-build sed 2q < COPYING > chromium-build/COPYING - cp simplyread.js keybind.js chromium/viable.js chromium/background.html chromium-build/ + cp simplyread.js keybind.js chromium/background.html chromium-build/ + cat viable.js chromium/viablehook.js > chromium-build/viable.js rsvg -w 19 -h 19 icon.svg chromium-build/icon.png rsvg -w 48 -h 48 icon.svg chromium-build/icon48.png rsvg -w 128 -h 128 icon.svg chromium-build/icon128.png diff --git a/TODO b/TODO index 9795f23..e9e915a 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,6 @@ chromium: generate appid for use in update xml see GenerateId in extension.cc of chrome for how it works - currently should be dbggpgfcgemloeeldimghohejgnkahdi gecko: use rapper and bourne shell script to sign diff --git a/chromium/updates.xml b/chromium/updates.xml index f938094..acf8ed1 100644 --- a/chromium/updates.xml +++ b/chromium/updates.xml @@ -1,6 +1,6 @@ - + diff --git a/chromium/viable.js b/chromium/viable.js deleted file mode 100755 index c957608..0000000 --- a/chromium/viable.js +++ /dev/null @@ -1,9 +0,0 @@ -/* See COPYING file for copyright, license and warranty details. */ - -function viable() { - var doc; - doc = (document.body === undefined) - ? window.content.document : document; - return doc.getElementsByTagName("p").length; -} -if(viable()) chrome.extension.sendRequest({}, function(response) {}); diff --git a/chromium/viablehook.js b/chromium/viablehook.js new file mode 100755 index 0000000..80bb673 --- /dev/null +++ b/chromium/viablehook.js @@ -0,0 +1 @@ +if(simplyread-viable()) chrome.extension.sendRequest({}, function(response) {}); diff --git a/gecko/chrome/content/simplyread.xul b/gecko/chrome/content/simplyread.xul index 2ed3ac8..87af5ea 100644 --- a/gecko/chrome/content/simplyread.xul +++ b/gecko/chrome/content/simplyread.xul @@ -1,10 +1,11 @@ +