From 41866cee95751a040a2a14bc9ea443650cfa6d7b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 12 Jan 2014 04:27:11 -1000 Subject: [PATCH] Working background push. --- manifest.json | 3 ++- popup.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 5f494c521..2fbafa2dd 100644 --- a/manifest.json +++ b/manifest.json @@ -16,7 +16,8 @@ }, "background": { - "pages": ["background.html"] + "scripts": [ "jquery.js", "jquery.atmosphere.js", "aes.js", "hmac-sha256.js", "lib-typedarrays.js", + "Long.min.js", "ByteBuffer.min.js", "ProtoBuf.min.js", "helpers.js", "background.js" ] }, "options_page": "options.html" diff --git a/popup.js b/popup.js index 5f504642d..00582ac1f 100644 --- a/popup.js +++ b/popup.js @@ -37,8 +37,8 @@ if (storage.getUnencrypted("number_id") === undefined) { } } - chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { - console.log("Got push message from background.js " + JSON.stringify(request)); + $(window).bind('storage', function() { + console.log("Got localStorage update"); fillMessages(); }); fillMessages();