Skip to content

Commit

Permalink
Rewrite extension to listen for keybinding (prettier#353)
Browse files Browse the repository at this point in the history
* Rewrite extension to listen for keybinding

* Update src/content/extension.js

Co-authored-by: Sibiraj <20282546+sibiraj-s@users.noreply.github.com>

* Remove files and address review comments

* Update src/content/extension.js

Co-authored-by: Sibiraj <20282546+sibiraj-s@users.noreply.github.com>

* Update deps

Co-authored-by: Sibiraj <20282546+sibiraj-s@users.noreply.github.com>
  • Loading branch information
kaicataldo and sibiraj-s authored Feb 1, 2021
1 parent adb820b commit 00a8c58
Show file tree
Hide file tree
Showing 11 changed files with 2,420 additions and 3,503 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"sourceDir": "extension/firefox/"
},
"scripts": {
"build:chrome": "PLATFORM=chrome node scripts/build.js",
"build:firefox": "PLATFORM=firefox node scripts/build.js",
"build:chrome": "cross-env PLATFORM=chrome node scripts/build.js",
"build:firefox": "cross-env PLATFORM=firefox node scripts/build.js",
"build": "yarn build:chrome && yarn build:firefox",
"dev:chrome": "PLATFORM=chrome node scripts/start.js",
"dev:firefox": "PLATFORM=firefox node scripts/start.js",
"dev:chrome": "cross-env PLATFORM=chrome node scripts/start.js",
"dev:firefox": "cross-env PLATFORM=firefox node scripts/start.js",
"launch:firefox": "web-ext run",
"lint": "eslint --ignore-path .gitignore .",
"format": "prettier . --write",
Expand All @@ -38,6 +38,7 @@
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"clean-webpack-plugin": "3.0.0",
"copy-webpack-plugin": "6.2.1",
"cross-env": "^7.0.3",
"css-loader": "5.0.0",
"eslint": "7.11.0",
"eslint-config-prettier": "6.11.0",
Expand All @@ -54,7 +55,7 @@
"sass": "1.26.10",
"sass-loader": "10.0.3",
"style-loader": "2.0.0",
"web-ext": "5.0.0",
"web-ext": "^5.5.0",
"webextension-polyfill": "0.6.0",
"webpack": "5.6.0",
"webpack-cli": "4.1.0"
Expand Down
11 changes: 11 additions & 0 deletions src/background/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import browser from "webextension-polyfill";

browser.commands.onCommand.addListener((command) => {
if (command !== "run-prettier-format") {
return;
}

browser.tabs.query({ active: true, currentWindow: true }, (tabs) => {
browser.tabs.sendMessage(tabs[0].id, { action: "runPrettierFormat" });
});
});
66 changes: 0 additions & 66 deletions src/content/button.js

This file was deleted.

45 changes: 0 additions & 45 deletions src/content/domUtils.js

This file was deleted.

Loading

0 comments on commit 00a8c58

Please sign in to comment.