summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL9
-rw-r--r--Makefile13
-rw-r--r--TODO6
-rw-r--r--chromium/background.html5
-rw-r--r--chromium/icon.pngbin0 -> 388 bytes
-rw-r--r--chromium/manifest.json8
-rwxr-xr-xreadable.js2
7 files changed, 41 insertions, 2 deletions
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 @@
+<html><head><script src="readable.js"></script><script>
+ chrome.browserAction.onClicked.addListener(function(tab) {
+ chrome.tabs.executeScript(null, {code:"readable();"});
+ });
+</script></head></html>
diff --git a/chromium/icon.png b/chromium/icon.png
new file mode 100644
index 0000000..5470e39
--- /dev/null
+++ b/chromium/icon.png
Binary files 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()
{