crittermike / shortkeys

A browser extension for custom keyboard shortcuts
https://www.shortkeys.app/
Other
987 stars 160 forks source link

Error in webconsole #424

Open ida opened 3 years ago

ida commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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".

egaille commented 3 years ago

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

ida commented 2 years ago

Also relates to #338