diff --git a/browser-plugins/webextension/manifest.json b/browser-plugins/webextension/manifest.json index 4181ef4..a94aa7b 100644 --- a/browser-plugins/webextension/manifest.json +++ b/browser-plugins/webextension/manifest.json @@ -49,13 +49,13 @@ "commands": { - "open_popup": + "_execute_browser_action": { "suggested_key": { "default": "Ctrl+Shift+S" }, - "description": "Add URI to remwharead." + "description": "Open “Add URI”-popup." } } } diff --git a/browser-plugins/webextension/options.html b/browser-plugins/webextension/options.html index d07ede7..2288688 100644 --- a/browser-plugins/webextension/options.html +++ b/browser-plugins/webextension/options.html @@ -8,6 +8,7 @@ +

You can edit shortcuts using the gear icon at the top right.

diff --git a/browser-plugins/webextension/options.js b/browser-plugins/webextension/options.js index 5150fa8..aba7d0d 100644 --- a/browser-plugins/webextension/options.js +++ b/browser-plugins/webextension/options.js @@ -16,5 +16,25 @@ function restore_options() }); } +function info_commands(commands) +{ + commands.forEach( + function(command) + { + var element = document.querySelector("#shortcuts"); + var para = document.createElement("p"); + + var text = document.createElement("strong"); + text.appendChild(document.createTextNode(command.shortcut + ": ")); + para.appendChild(text); + para.appendChild(document.createTextNode(command.description)); + + element.appendChild(para); + }); +} + document.addEventListener('DOMContentLoaded', restore_options); document.querySelector("#archive").addEventListener("change", save_options); + +var get_commands = browser.commands.getAll(); +get_commands.then(info_commands);