barbushin / javascript-errors-notifier

Google Chrome and Firefox extension that notifies about JavaScritp errors by icon in address bar & popups
MIT License
206 stars 62 forks source link

Hi, was this pulled from the chrome web store? As a product dev, this is literally my favorite extension #101

Closed coinzdude closed 1 year ago

coinzdude commented 3 years ago

getting not found: https://chrome.google.com/webstore/detail/javascript-errors-notifie/jafmfknfnkoekkdocjiaipcnmkklaajd

Just a note: I have a partially mostly working published fork mentioned below in this thread.

https://chrome.google.com/webstore/detail/javascript-errors-notifie/lplhclpeegjedapdliokcacmphgcnlnd

andre-ellrich-adup commented 3 years ago

yes I need this as well

gabema commented 3 years ago

It's also automatically disabled on Edge (having installed the extension from the google web store). The following error message is reported:

This extension has been disabled because it's been marked unsafe by the Chrome Web Store.

Was there malware in this extension?

Agree with the original poster that this extension was awesome. May need to review the source and install manually if safe.

wmertens commented 3 years ago

On Chrome, the message is "This extension violates the Chrome Web Store policy."

wmertens commented 3 years ago

I compared master and the installed extension, this is the diff. It looks like the extension has some changes in images, and it adds usage tracking via GA.

Only in /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/: _metadata
Only in /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/: background.html
diff -ru javascript-errors-notifier-master/background.js /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/background.js
--- javascript-errors-notifier-master/background.js     2018-09-06 13:21:53.000000000 +0200
+++ /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/background.js      2020-04-19 04:55:56.713181324 +0200
@@ -1,4 +1,8 @@
-function htmlentities(str) {
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-64830728-2']);
+_gaq.push(['_trackPageview']);
+
+function htmlentities(str) {
        var div = document.createElement('div');
        div.appendChild(document.createTextNode(str));
        return div.innerHTML;
@@ -213,6 +217,22 @@
        }
        else if(data._errors) {
                handleErrorsRequest(data, sender, sendResponse);
-       }
+
+        if(localStorage['showIcon']) {
+            _gaq.push(['_trackEvent', 'errorWithIcon', 'clicked']);
+        }
+        else {
+            _gaq.push(['_trackEvent', 'errorWithNoIcon', 'clicked']);
+        }
+       }
+       else if(data._popup) {
+        _gaq.push(['_trackEvent', 'errorWithPopup', 'clicked']);
+    }
        return true;
 });
+
+(function() {
+  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+  ga.src = 'https://ssl.google-analytics.com/ga.js';
+  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
Binary files javascript-errors-notifier-master/img/error_128.png and /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/img/error_128.png differ
Binary files javascript-errors-notifier-master/img/error_19_disabled.png and /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/img/error_19_disabled.png differ
Binary files javascript-errors-notifier-master/img/error_38_disabled.png and /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/img/error_38_disabled.png differ
Binary files javascript-errors-notifier-master/img/error_48.png and /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/img/error_48.png differ
diff -ru javascript-errors-notifier-master/manifest.json /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/manifest.json
--- javascript-errors-notifier-master/manifest.json     2018-09-06 13:21:53.000000000 +0200
+++ /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/manifest.json      2020-04-19 04:55:56.713181324 +0200
@@ -1,51 +1,35 @@
 {
-       "name": "JavaScript Errors Notifier",
-       "short_name": "js_error",
-       "description": "Notifies JavaScript errors by icon in toolbar bar or notification popup",
-       "version": "3.1.4",
-       "manifest_version": 2,
-       "background": {
-               "scripts": [
-                       "background.js"
-               ]
-       },
-       "content_scripts": [
-               {
-                       "all_frames": true,
-                       "js": [
-                               "content.js"
-                       ],
-                       "matches": [
-                               "<all_urls>"
-                       ],
-                       "run_at": "document_start"
-               }
-       ],
-       "options_page": "options.html",
-       "icons": {
-               "128": "img/error_128.png",
-               "16": "img/error_16.png",
-               "48": "img/error_48.png"
-       },
-       "incognito": "spanning",
-       "page_action": {
-               "default_icon": {
-                       "19": "img/error_19_disabled.png",
-                       "38": "img/error_38_disabled.png"
-               },
-               "default_popup": "popup.html"
-       },
-       "web_accessible_resources": [
-               "img/error_64.png",
-               "img/error_38.png",
-               "img/error_19.png",
-               "popup.html",
-               "options.html"
-       ],
-       "permissions": [
-               "<all_urls>",
-               "tabs",
-               "storage",
-               "webRequest"
-       ]
+   "background": {
+      "page": "background.html"
+   },
+   "content_scripts": [ {
+      "all_frames": true,
+      "js": [ "content.js" ],
+      "matches": [ "\u003Call_urls>" ],
+      "run_at": "document_start"
+   } ],
+   "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
+   "description": "Notifies JavaScript errors by icon in toolbar bar or notification popup",
+   "icons": {
+      "128": "img/error_128.png",
+      "16": "img/error_16.png",
+      "48": "img/error_48.png"
+   },
+   "incognito": "spanning",
+   "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRhiOYOSDraMvGibhl/qi0BGYNBExiAuxO+KycUCFp9fgAQ2OOQSnl/aNh5JlBiQf5yMcJXLQ3KkWxctHDJezlOTj1qSHFqttXCMvfMj2cQ1BAJpRLBUp3uSWuGryPBEMv99sGMTpyy3IXyLLvjqGqpK8LOx6PEw8Mv1e4Zsc+0wIDAQAB",
+   "manifest_version": 2,
+   "name": "JavaScript Errors Notifier",
+   "options_page": "options.html",
+   "page_action": {
+      "default_icon": {
+         "19": "img/error_19_disabled.png",
+         "38": "img/error_38_disabled.png"
+      },
+      "default_popup": "popup.html"
+   },
+   "permissions": [ "\u003Call_urls>", "tabs", "storage", "webRequest" ],
+   "short_name": "js_error",
+   "update_url": "https://clients2.google.com/service/update2/crx",
+   "version": "3.1.5",
+   "web_accessible_resources": [ "img/error_64.png", "img/error_38.png", "img/error_19.png", "popup.html", "options.html" ]
 }
diff -ru javascript-errors-notifier-master/popup.js /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/popup.js
--- javascript-errors-notifier-master/popup.js  2018-09-06 13:21:53.000000000 +0200
+++ /home/wmertens/.config/google-chrome/Default/Extensions/jafmfknfnkoekkdocjiaipcnmkklaajd/3.1.5_0/popup.js   2020-04-19 04:55:56.713181324 +0200
@@ -64,5 +64,12 @@
                        setTimeout(autoSize, 500); // hot fix for slow CPU
                }
        });
+
+    chrome.runtime.sendMessage({
+        _popup: true,
+        url: window.location.href
+    }, function(response) {
+        options = response;
+    });
 });
wmertens commented 3 years ago

I downloaded the code as a .zip, unpacked it and told Chrome to load it as an unpacked extension.

chrismccoy commented 3 years ago

i use this as well, by the diff posted above, looks like it was tracking all javascript errors from all sites being used to the devs GA from every installation.

wmertens commented 3 years ago

@chrismccoy Hmm I read that as tracking loads and clicks only? And it doesn't know which page it's loaded on? Pretty innocent IMHO.

chrismccoy commented 3 years ago

@chrismccoy Hmm I read that as tracking loads and clicks only? And it doesn't know which page it's loaded on? Pretty innocent IMHO.

ya just re-read it, hopefully it gets added back or someone forks it without the GA code and submits it, the background.js source here doesnt have the GA code, only the copy in releases does

rcastagno commented 2 years ago

@chrismccoy "only the copy in releases does"

that's definitely "not nice"

@wmertens "Pretty innocent IMHO."

Maybe, but maybe no: it can give insight into internal vulnerabilities of private software, for example.

TowhidKashem commented 2 years ago

Since it's been taken down one option is to just run it locally, I've been doing it for the past week and it's been working without issue:

  1. git clone git@github.com:barbushin/javascript-errors-notifier.git
  2. Go to chrome://extensions/
  3. Toggle "Developer mode"
  4. Click "Load unpacked"
crutch12 commented 2 years ago

@barbushin could you republish this extension in chrome extensions store? Пж..

coinzdude commented 1 year ago

I just now published this for review to the chrome store . Will be interesting to see if it goes through.

Sethback commented 1 year ago

I just now published this for review to the chrome store . Will be interesting to see if it goes through.

Any news on this? Thank you.

coinzdude commented 1 year ago

Yes, some challenges to get this going. I did get the chrome store publishing account. That helped to see what is no longer allowed with this extension. Manifest v2 to v3 conversion turned into a challenge, requiring me to begin learning how this extension works and what it can't do the same in v3. Additionally I'm not certain if it's possible with v3 but I am still interested to try and also to take any code contribution or suggestions.

I'll look to clean up what I have and publish it in my fork.

coinzdude commented 1 year ago

https://github.com/coinzdude/javascript-errors-notifier/tree/manifest-v3

My most recent fork is here ^. This attempts to get the extension installable and runnable without errors and without store violations (manifest policy, code, broken web links, etc)

I had hoped to simply publish this as-is, but the manifest requirements changed from v2 to v3 which required architectural changes to the code. There are two major changes.

  1. Storage calls must be async. I am not yet knowledgeable enough to know if my changes are working
  2. JS code required in the page loading scope can no longer by loaded on the fly, and must be separated in a manner like the super knowledgeable Rob W, https://stackoverflow.com/users/938089/rob-w, covers here https://stackoverflow.com/questions/9515704/access-variables-and-functions-defined-in-page-context-using-a-content-script/9517879#9517879

I am guessing the biggest challenge right now is in the custom event handler and how that talks between the front-end loaded code and the service worker.

coinzdude commented 1 year ago

My next step is likely to identify what is broken and produce the smallest question I can ask StackOverflow with an example and hopefully get some resolution

coinzdude commented 1 year ago

Here's something very roughly working via manifest v3. It will alert with a clickable icon like below. There's a bit to do from here, as this doesn't use the settings storage, and probably has an overloaded manifest as a landgrab to get a bunch of stuff it likely does not need... and probably a bunch of other things, but it does look like at least it will do what I was using manifest v2 for which was to tell me there's a JS error and let me see easily what it is. image I am very happy to get any assistance here, but for now, I will clean this up, try to get it to use the user settings, and see if I can publish it into the store.

https://github.com/coinzdude/javascript-errors-notifier/tree/manifest-v3

coinzdude commented 1 year ago

This https://github.com/coinzdude/javascript-errors-notifier/tree/manifest-v3 is now beginning to work with storage. There's a bit more to clean up, remove unwanted permissions, and to get some behaviors working like "auto-pop-up notification" user preferences, but the path forward is pretty clear. I'll try to publish this as-is into the chrome store to see what happens.

coinzdude commented 1 year ago

Got a little more working with popup toggles and local storage. Waiting on chrome store first publish attempt to go through and I'll update it.

coinzdude commented 1 year ago

Another big update here https://github.com/coinzdude/javascript-errors-notifier/tree/manifest-v3, options panel is working with storage and reload. While JS errors seem to be caught nicely, I see I need to go through a set of tests to see what is not yet getting caught, like 404 errors... So close, almost there.

coinzdude commented 1 year ago

This is now published here https://chrome.google.com/webstore/detail/javascript-errors-notifie/lplhclpeegjedapdliokcacmphgcnlnd, but this version is just a first pass. A much better working version with options panel support and display issues resolved was just submitted.

coinzdude commented 1 year ago

I need to detach or extract my github fork so that issues can be submitted to it. I can also fully reset the repo, but I'd prefer to keep some relationship to all the history, etc. Any advice?

Detach - To create a new fork network containing only this repository. All of its sub-forks are re-parented and stay in the original fork network.

Extract - To move the fork and all its subforks into a new network. This repository becomes the new root.

https://stackoverflow.com/questions/16052477/delete-fork-dependency-of-a-github-repository

coinzdude commented 1 year ago

It seems the Chrome Store has some longer delays for extension updates. I made an initial publish attempt with something that simply runs, just to see what issues there would be to publish. After it went live, I published a more fully working version and am still waiting for it to launch. I'll update here when a much better working version is live.

coinzdude commented 1 year ago

Working update is live in the Chrome Store! I will look to break off the fork so issues can be submitted, contributions can be merged, etc. Thank you @barbushin for your amazing work!

coinzdude commented 1 year ago

Fork is separated and taking issues, https://github.com/coinzdude/javascript-errors-notifier/

coinzdude commented 1 year ago

Another update, 4.04 beta is live on github and pushed to the chrome store (currently, taking about 3 days to go live). The latest allows you to specify domains to apply filtering. Uncheck "show icon on all sites" and then specify the domains you want to be active.