From cf8c1d39eb4d2ccd8cb5dfbe7931bc2aa116a3c7 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 11 Nov 2010 19:46:20 +0000 Subject: Add basic chromium extension --- INSTALL | 9 +++++++++ Makefile | 13 ++++++++++++- TODO | 6 ++++++ chromium/background.html | 5 +++++ chromium/icon.png | Bin 0 -> 388 bytes chromium/manifest.json | 8 ++++++++ readable.js | 2 +- 7 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 chromium/background.html create mode 100644 chromium/icon.png create mode 100644 chromium/manifest.json diff --git a/INSTALL b/INSTALL index b4f672f..ef66398 100644 --- a/INSTALL +++ b/INSTALL @@ -10,6 +10,15 @@ build it by running: make xpi +# Chromium + +Readable also exists as an extension for chromium (and derived browsers.) +It isn't currently available on the "extensions gallery," but if someone +wants to post it there, please go ahead. For now you can get it from the +readable web page, or by running: + + make crx + # Surf To use readable from surf, and trigger it from ctrl-alt-r, add the diff --git a/Makefile b/Makefile index 53d7ec6..aee2b52 100644 --- a/Makefile +++ b/Makefile @@ -35,5 +35,16 @@ xpi: readable.js gecko/install.rdf gecko/chrome.manifest gecko/chrome/content/re @rm -rf gecko-build @echo $(NAME)-$(VERSION).xpi $(NAME)-$(VERSION).xpi.sig -.PHONY: dist xpi +crx: readable.js chromium/icon.png chromium/manifest.json chromium/background.html + @rm -rf chromium-build + @mkdir chromium-build + @cp COPYING readable.js chromium/icon.png chromium/background.html chromium-build/ + @sed "s/VERSION/$(VERSION)/g" < chromium/manifest.json > chromium-build/manifest.json + @chromium-browser --pack-extension=chromium-build + @mv chromium-build.crx $(NAME)-$(VERSION).crx + @rm -r chromium-build chromium-build.pem + @gpg -b < $(NAME)-$(VERSION).crx > $(NAME)-$(VERSION).crx.sig + @echo $(NAME)-$(VERSION).crx $(NAME)-$(VERSION).crx.sig + +.PHONY: dist xpi crx .SUFFIXES: ttl html diff --git a/TODO b/TODO index fbc17fe..59d64f5 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,9 @@ chromium extension http://code.google.com/chrome/extensions/index.html + packaging + http://code.google.com/chrome/extensions/packaging.html + http://code.google.com/chrome/extensions/hosting.html + http://code.google.com/chrome/extensions/crx.html + use a simple script to create crx rather than chromium-browser + handle signing extension properly epiphany extension http://projects.gnome.org/epiphany/extensions make tests, which process sample html files and check the output diff --git a/chromium/background.html b/chromium/background.html new file mode 100644 index 0000000..669ff78 --- /dev/null +++ b/chromium/background.html @@ -0,0 +1,5 @@ + diff --git a/chromium/icon.png b/chromium/icon.png new file mode 100644 index 0000000..5470e39 Binary files /dev/null and b/chromium/icon.png differ diff --git a/chromium/manifest.json b/chromium/manifest.json new file mode 100644 index 0000000..875c633 --- /dev/null +++ b/chromium/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "Readable", + "version": "VERSION", + "background_page": "background.html", + "permissions": [ "tabs", "*://*/*" ], + "content_scripts": [{"matches": ["*://*/*"], "js": ["readable.js"]}], + "browser_action": { "default_icon": "icon.png" } +} diff --git a/readable.js b/readable.js index 726f522..6fff651 100755 --- a/readable.js +++ b/readable.js @@ -4,7 +4,7 @@ * See COPYING file for copyright, license and warranty details. */ -if(window.content.document.readable_original === undefined) window.content.document.readable_original = false; +if(window.content && window.content.document.readable_original === undefined) window.content.document.readable_original = false; function readable() { -- cgit v1.2.3