aboutsummaryrefslogtreecommitdiff
path: root/js/firefox/page-shim.js
diff options
context:
space:
mode:
authorEinar Egilsson <einar@einaregilsson.com>2015-09-21 14:44:37 +0000
committerEinar Egilsson <einar@einaregilsson.com>2015-09-21 14:44:37 +0000
commit720c2643cd4bcfbc63b67d7d74c476496c805b8b (patch)
tree311ad09d1b71ebd10ff9500065c55eabb42a71de /js/firefox/page-shim.js
parentb2ba3216ea5dbe6a74fdfa75611fce95c1481316 (diff)
Mostly working on Firefox
Diffstat (limited to 'js/firefox/page-shim.js')
-rw-r--r--js/firefox/page-shim.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/firefox/page-shim.js b/js/firefox/page-shim.js
index fc63f89..3531fa4 100644
--- a/js/firefox/page-shim.js
+++ b/js/firefox/page-shim.js
@@ -5,7 +5,7 @@
var callbacks = {};
function send(type, message, callback) {
var id = messageId++;
- window.postMessage({sender:'page', messageId:id, messageType:type, payload:message}, '*');
+ window.postMessage({sender:'page', url:location.href, messageId:id, messageType:type, payload:message}, '*');
callbacks[id] = callback;
}
@@ -23,6 +23,12 @@
}
});
+ var req = new XMLHttpRequest();
+ req.overrideMimeType('application/json');
+ req.open("GET", 'package.json', false);
+ req.send();
+ var manifest = JSON.parse(req.responseText);
+
window.chrome = {
storage : {
local : {
@@ -53,7 +59,7 @@
runtime : {
getManifest : function() {
- return { version : '3.0' };
+ return manifest;
}
}
};