diff --git a/postmessage_tracker-1.0.1-fx.xpi b/postmessage_tracker-1.0.1-fx.xpi new file mode 100644 index 0000000..4766401 Binary files /dev/null and b/postmessage_tracker-1.0.1-fx.xpi differ diff --git a/chrome/background.js b/src/background.js similarity index 93% rename from chrome/background.js rename to src/background.js index dfaefdb..637dcc5 100644 --- a/chrome/background.js +++ b/src/background.js @@ -88,10 +88,4 @@ chrome.tabs.onActivated.addListener(function(activeInfo) { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { selectedId = tabs[0].id; refreshCount(); -}); - -chrome.extension.onConnect.addListener(function(port) { - port.onMessage.addListener(function(msg) { - port.postMessage({listeners:tab_listeners}); - }); -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/chrome/content_script.js b/src/content_script.js similarity index 92% rename from chrome/content_script.js rename to src/content_script.js index e1b4c90..9bae78a 100644 --- a/chrome/content_script.js +++ b/src/content_script.js @@ -104,11 +104,11 @@ var injectedJS = function(pushstate, addeventlistener) { }); var c = function(listener) { var listener_str = listener.toString() - if(listener_str.match(/\.deep.*apply.*captureException/s)) return 'raven'; - else if(listener_str.match(/arguments.*(start|typeof).*err.*finally.*end/s) && listener["nr@original"] && typeof listener["nr@original"] == "function") return 'newrelic'; - else if(listener_str.match(/rollbarContext.*rollbarWrappedError/s) && listener._isWrap && + if(listener_str.match(/\.deep[^\x05]*apply[^\x05]*captureException/)) return 'raven'; + else if(listener_str.match(/arguments[^\x05]*(start|typeof)[^\x05]*err[^\x05]*finally[^\x05]*end/) && listener["nr@original"] && typeof listener["nr@original"] == "function") return 'newrelic'; + else if(listener_str.match(/rollbarContext[^\x05]*rollbarWrappedError/) && listener._isWrap && (typeof listener._wrapped == "function" || typeof listener._rollbar_wrapped == "function")) return 'rollbar'; - else if(listener_str.match(/autoNotify.*(unhandledException|notifyException)/s) && typeof listener.bugsnag == "function") return 'bugsnag'; + else if(listener_str.match(/autoNotify[^\x05]*(unhandledException|notifyException)/) && typeof listener.bugsnag == "function") return 'bugsnag'; return false; } diff --git a/chrome/manifest.json b/src/manifest.json similarity index 80% rename from chrome/manifest.json rename to src/manifest.json index 2d6f321..7fdc115 100644 --- a/chrome/manifest.json +++ b/src/manifest.json @@ -2,7 +2,13 @@ "manifest_version": 2, "name": "postMessage-tracker", "description": "Monitors and indicates postMessage-listeners in the current window.", - "version": "1.0.0", + "version": "1.0.1", + "browser_specific_settings": { + "gecko": { + "id": "karim@karimrahal.com", + "strict_min_version": "57.0" + } + }, "background": { "scripts": [ "background.js" @@ -33,4 +39,4 @@ "http:\/\/*\/", "https:\/\/*\/" ] -} \ No newline at end of file +} diff --git a/chrome/options.html b/src/options.html similarity index 92% rename from chrome/options.html rename to src/options.html index 0302117..30b7a15 100644 --- a/chrome/options.html +++ b/src/options.html @@ -1,4 +1,5 @@ +
diff --git a/chrome/options.js b/src/options.js similarity index 100% rename from chrome/options.js rename to src/options.js diff --git a/chrome/popup.html b/src/popup.html similarity index 97% rename from chrome/popup.html rename to src/popup.html index bcce81c..3c61449 100644 --- a/chrome/popup.html +++ b/src/popup.html @@ -1,4 +1,5 @@ + diff --git a/chrome/popup.js b/src/popup.js similarity index 72% rename from chrome/popup.js rename to src/popup.js index 617236a..f20dcb5 100644 --- a/chrome/popup.js +++ b/src/popup.js @@ -1,21 +1,9 @@ -var port = chrome.extension.connect({ - name: "Sample Communication" -}); - - -function loaded() { - port.postMessage("get-stuff"); - port.onMessage.addListener(function(msg) { - console.log("message recieved yea: ", msg); - chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { - selectedId = tabs[0].id; - listListeners(msg.listeners[selectedId]); - }); +chrome.runtime.getBackgroundPage(function (page) { + chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { + selectedId = tabs[0].id; + listListeners(page.tab_listeners[selectedId]); }); -} - -window.onload = loaded -//addEventListener('DOMContentLoaded', loaded); +}); function listListeners(listeners) { var x = document.getElementById('x');