diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f49f1d..276d904 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,11 @@ jobs: # TODO preserve apt cache.. - run: sudo apt install python3-pip - run: python3 -m pip install --user mypy pylint pytest - - run: sudo apt install httpie # only used for tests + + # test only dependencies + - run: sudo apt install httpie + - run: python3 -m pip install --user selenium pyautogui + # - run: name: pylint diff --git a/src/manifest.json b/src/manifest.json index eb41c2d..9c8a049 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -17,18 +17,10 @@ }, "commands": { "capture-simple": { - "description": "Quick capture: url, title and selection", - "suggested_key": { - "default": "Ctrl+Shift+C", - "mac": "Command+Shift+C" - } + "description": "Quick capture: url, title and selection" }, "_execute_browser_action": { - "description": "Capture page, with extra information", - "suggested_key": { - "default": "Ctrl+Shift+Y", - "mac": "Command+Shift+Y" - } + "description": "Capture page, with extra information" } }, "manifest_version": 2, diff --git a/webpack.config.js b/webpack.config.js index 1ef7082..b7f4a45 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,17 +26,39 @@ if (env.ANY_HOST) { permissions.push("https://*/capture"); } + +// Firefox wouldn't let you rebind its default shortcuts most of which use Shift +// On the other hand, Chrome wouldn't let you use Alt +const modifier = target === 'chrome' ? 'Shift' : 'Alt'; + +// ugh. declarative formats are shit. +const commandsExtra = { + "capture-simple": { + "suggested_key": { + "default": `Ctrl+${modifier}+C`, + "mac": `Command+${modifier}+C` + } + }, + "_execute_browser_action": { + "suggested_key": { + "default": `Ctrl+${modifier}+Y`, + "mac": `Command+${modifier}+Y` + } + }, +}; + const manifestExtra = { name: pkg_name, version: pkg.version, description: pkg.description, permissions: permissions, + commands: commandsExtra, }; -if (target == 'chrome') { +if (target === 'chrome') { manifestExtra.options_ui = {chrome_style: true}; } -if (target == 'firefox') { +if (target === 'firefox') { manifestExtra.options_ui = {browser_style: true}; manifestExtra.browser_action = {browser_style: true}; }