https://github.com/offirmo/hello-world-browser-extension
https://github.com/offirmo/hello-world-browser-extension
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/offirmo/hello-world-browser-extension
- Owner: Offirmo
- License: unlicense
- Created: 2016-08-30T16:53:22.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-05-09T10:08:44.000Z (about 5 years ago)
- Last Synced: 2024-04-09T14:32:14.085Z (over 2 years ago)
- Language: JavaScript
- Size: 51.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hello-world-browser-extension
The simplest, most trivial browser extension, featuring:
* content script (aka. injected)
* background script
* toolbar button opening a popup
* options page
* notification
* ...
## references
* https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Your_first_WebExtension
* https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Your_second_WebExtension
* https://developer.chrome.com/extensions/getstarted
API
* permission field
* permission ids https://developer.chrome.com/extensions/declare_permissions#manifest
* match patterns https://developer.chrome.com/extensions/match_patterns
```json
"permissions": [
"alarms",
"background",
"bookmarks",
"clipboardRead",
"clipboardWrite",
"contentSettings",
"contextMenus",
"cookies",
"debugger",
"downloads",
"geolocation",
"history",
"idle",
"management",
"nativeMessaging",
"notifications",
"storage",
"tabs",
"unlimitedStorage",
"webNavigation"
],
```
Capabilities
* intercept requests https://developer.chrome.com/extensions/webRequest
* TODO proxy? NOT SUPPORTED ON CHROME https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy
* modify request result = not possible? proxy
* achievable with content script + https://intoli.com/blog/sandbox-breakout/
Techniques
* communicate between contexts https://dev.to/christiankaindl/a-webextension-guide-36ag
* using modules https://medium.com/front-end-weekly/es6-modules-in-chrome-extensions-an-introduction-313b3fce955b
See also
* TODO https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/onboarding_upboarding_offboarding_best_practices