Skip to content

Commit 00a8c58

Browse files
Kai Cataldosibiraj-s
andauthored
Rewrite extension to listen for keybinding (#353)
* Rewrite extension to listen for keybinding * Update src/content/extension.js Co-authored-by: Sibiraj <[email protected]> * Remove files and address review comments * Update src/content/extension.js Co-authored-by: Sibiraj <[email protected]> * Update deps Co-authored-by: Sibiraj <[email protected]>
1 parent adb820b commit 00a8c58

File tree

11 files changed

+2420
-3503
lines changed

11 files changed

+2420
-3503
lines changed

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"sourceDir": "extension/firefox/"
99
},
1010
"scripts": {
11-
"build:chrome": "PLATFORM=chrome node scripts/build.js",
12-
"build:firefox": "PLATFORM=firefox node scripts/build.js",
11+
"build:chrome": "cross-env PLATFORM=chrome node scripts/build.js",
12+
"build:firefox": "cross-env PLATFORM=firefox node scripts/build.js",
1313
"build": "yarn build:chrome && yarn build:firefox",
14-
"dev:chrome": "PLATFORM=chrome node scripts/start.js",
15-
"dev:firefox": "PLATFORM=firefox node scripts/start.js",
14+
"dev:chrome": "cross-env PLATFORM=chrome node scripts/start.js",
15+
"dev:firefox": "cross-env PLATFORM=firefox node scripts/start.js",
1616
"launch:firefox": "web-ext run",
1717
"lint": "eslint --ignore-path .gitignore .",
1818
"format": "prettier . --write",
@@ -38,6 +38,7 @@
3838
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
3939
"clean-webpack-plugin": "3.0.0",
4040
"copy-webpack-plugin": "6.2.1",
41+
"cross-env": "^7.0.3",
4142
"css-loader": "5.0.0",
4243
"eslint": "7.11.0",
4344
"eslint-config-prettier": "6.11.0",
@@ -54,7 +55,7 @@
5455
"sass": "1.26.10",
5556
"sass-loader": "10.0.3",
5657
"style-loader": "2.0.0",
57-
"web-ext": "5.0.0",
58+
"web-ext": "^5.5.0",
5859
"webextension-polyfill": "0.6.0",
5960
"webpack": "5.6.0",
6061
"webpack-cli": "4.1.0"

src/background/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import browser from "webextension-polyfill";
2+
3+
browser.commands.onCommand.addListener((command) => {
4+
if (command !== "run-prettier-format") {
5+
return;
6+
}
7+
8+
browser.tabs.query({ active: true, currentWindow: true }, (tabs) => {
9+
browser.tabs.sendMessage(tabs[0].id, { action: "runPrettierFormat" });
10+
});
11+
});

src/content/button.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/content/domUtils.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)