Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop webextension-polyfill #88

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 4 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,16 @@
],
"xo": {
"envs": [
"browser"
],
"rules": {
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "browser"
}
]
}
"browser",
"webextensions"
]
},
"stylelint": {
"extends": "stylelint-config-xo"
},
"dependencies": {
"webext-base-css": "^1.4.1",
"webext-options-sync": "^3.1.0",
"webextension-polyfill": "^0.9.0"
"webext-options-sync": "^3.1.0"
},
"devDependencies": {
"@parcel/config-webextension": "^2.6.2",
Expand Down
5 changes: 1 addition & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# browser-extension-template

[link-webext-polyfill]: https://github.com/mozilla/webextension-polyfill
[link-rgh]: https://github.com/sindresorhus/refined-github
[link-ngh]: https://github.com/sindresorhus/notifier-for-github
[link-hfog]: https://github.com/sindresorhus/hide-files-on-github
[link-tsconfig]: https://github.com/sindresorhus/tsconfig
[link-options-sync]: https://github.com/fregante/webext-options-sync
[link-cws-keys]: https://github.com/DrewML/chrome-webstore-upload/blob/master/How%20to%20generate%20Google%20API%20keys.md
[link-cws-keys]: https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md
[link-amo-keys]: https://addons.mozilla.org/en-US/developers/addon/api/key

> Cross-browser extension boilerplate - barebones template with Parcel 2, options handler and auto-publishing.
Expand All @@ -19,10 +18,8 @@ Screenshot of extension options:

- Uses Manifest v3 ([not yet compatible with Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=1578284))
- Use npm dependencies thanks to Parcel 2.
- Use modern promise-based `browser.*` APIs [webextension-polyfill][link-webext-polyfill].
- [Auto-syncing options](#auto-syncing-options).
- [Auto-publishing](#publishing) with auto-versioning and support for manual releases.
- [Extensive configuration documentation](#configuration).

## Getting started

Expand Down
3 changes: 1 addition & 2 deletions source/content.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import browser from 'webextension-polyfill';
import optionsStorage from './options-storage.js';

console.log('💈 Content script loaded for', browser.runtime.getManifest().name);
console.log('💈 Content script loaded for', chrome.runtime.getManifest().name);
async function init() {
const options = await optionsStorage.getAll();
const color = 'rgb(' + options.colorRed + ', ' + options.colorGreen + ',' + options.colorBlue + ')';
Expand Down
3 changes: 0 additions & 3 deletions source/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import 'webext-base-css';
import './options.css';

// Don't forget to import this wherever you use it
import browser from 'webextension-polyfill';

import optionsStorage from './options-storage.js';

const rangeInputs = [...document.querySelectorAll('input[type="range"][name^="color"]')];
Expand Down