shortkeys icon indicating copy to clipboard operation
shortkeys copied to clipboard

Error in webconsole

Open ida opened this issue 4 years ago • 5 comments

When this add-on is enabled, every visited page shows this error in the web-inspector-console:

Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data

On the right side of the error-line, where usually the file-path of the error causing script is displayed, it says undefined :(

This was particulary annoying, because I tried to debug the server-side code of the webpage, until thinking of checking browser add-ons.

ida avatar May 11 '21 15:05 ida

This related issue suggests to ex- and import the shortkeys: https://github.com/mikecrittenden/shortkeys/issues/315

So I went to settings, landed on moz-extension://8a332dc9-acb9-457e-a9f1-fb8c6e82163b/options/options.html where the one and only defined shortcut (alt+q) didn't show up. Entered and saved the shortcut in these settings and the error disappears!

ida avatar May 11 '21 15:05 ida

This is reproducible. Immediately after install the error occurs until a save action via "Preferences" is done. My guess is that the settings are stored in a json-file and that this file doesn't exist initially, thus the parsing error.

If a save-action via "Manage Extension Shortcuts" is done, the error persists. That explains why me and #315 had the error even after defining one or more shortcuts in first place.

The addon-description should point out how to define a shortcut and whether that should be done via "Preferences" or "Manage Extension Shortcuts".

ida avatar May 12 '21 08:05 ida

As of july 06th 2021, the problem persists. If saving a shortcut in extension parameters, the error disappears. (my extensions are shared across all my computers, but my dev-computer does not use any shortkeys, so i had the error on my dev-computer...)

Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data

egaille avatar Jul 06 '21 13:07 egaille

Also relates to #338

ida avatar Nov 25 '21 07:11 ida