diff --git a/kbd.js b/kbd.js index e53a93e..dc0beb8 100644 --- a/kbd.js +++ b/kbd.js @@ -12,6 +12,7 @@ if (typeof browser === 'undefined'){ function onGot(items){ console.log( items ) + // should instead be used, fow now only useful in addWiki() } function onError(error) { @@ -47,14 +48,18 @@ document.addEventListener("keyup", function(event) { }) // could then grow userActions by the user themselves, save in localStorage, etc without having to rebuild extension -// note that i is different from I (which is here capture as I + Shift) +// note that i is different from I (which is here captured as I + Shift) let userActions = [ { key: 'r', action: 'window.location.reload()'}, { key: 'x', action: 'autoscroll()'}, { key: 'b', action: 'history.back()'}, { key: 'a', action: 'addWiki()'}, { key: 'n', action: 'firstTab()'}, - { key: 'r', action: 'window.location.reload()'}, + { key: 'P', mods: ['Shift'], action: 'window.open("https://account.proton.me/")'}, + { key: 'i', action: 'window.open("https://fabien.benetou.fr")'}, + // could be generalize to any bookmarks but needs to be set first, should not be hardcoded like here + // for multiple ones would have to handle successive keys, e.g. gtH for go to Home + // currently handling single key with modifiers { key: 'h', action: 'alert("r to reload, h for help, etc")'}, { key: 'h', mods: ['Alt'], action: 'alert("modified help!")'}, ] diff --git a/manifest.json b/manifest.json index 310aba2..c188456 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "keyboard", - "version": "1785831306", + "version": "1785936598", "description": "Adds keyboard capabilities shortuts for content on your local filesystem.", @@ -27,7 +27,7 @@ "page": "options.html" }, - "permissions": ["storage"] + "permissions": ["storage", "tabs"] diff --git a/options.html b/options.html index 10669d5..05ef50c 100644 --- a/options.html +++ b/options.html @@ -10,8 +10,12 @@