mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
Added missing README files and updated some existing ones
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# open-my-page
|
||||
|
||||
## What it does
|
||||
|
||||
This extension includes:
|
||||
|
||||
* a background script, "background.js"
|
||||
@@ -8,7 +10,7 @@ This extension includes:
|
||||
|
||||
All it does is: when the user clicks the button, open "my-page.html" in a new tab.
|
||||
|
||||
It shows:
|
||||
## What it shows
|
||||
|
||||
* how to listen for browser action clicks in a background script
|
||||
* how to open a page packaged with your extension
|
||||
|
||||
15
page-to-extension-messaging/README.md
Normal file
15
page-to-extension-messaging/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# page-to-extension-messaging
|
||||
|
||||
## What it does
|
||||
|
||||
This extension includes a content script, which is injected only into: "https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html".
|
||||
|
||||
The content script listens for clicks on a particular button on the page. When the button is clicked, the content script sends a message to any scripts running in the page.
|
||||
|
||||
Conversely, the content script listens for messages from the same window posted using window.postMessage. When the content script receives such a message, it displays an alert.
|
||||
|
||||
To test it out, visit https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html and press the buttons. One button sends a message from the page script to the content script, the other button sends a message in the other direction.
|
||||
|
||||
## What it shows
|
||||
|
||||
How to exchange messages between an extension's content scripts, and scripts running in a web page.
|
||||
@@ -1,8 +1,11 @@
|
||||
# tabs, tabs, tabs
|
||||
|
||||
This extension includes:
|
||||
## What it does
|
||||
|
||||
* a browser action
|
||||
* a page "tabs.html" with a script "tabs.js"
|
||||
This extension includes a browser action with a popup specified as "tabs.html".
|
||||
|
||||
It shows a list of tab methods that you can perform on the active tab.
|
||||
The popup lets the user perform various simple operations using the tabs API.
|
||||
|
||||
# What it shows
|
||||
|
||||
Demonstration of various tabs API functions.
|
||||
|
||||
14
user-agent-rewriter/README.md
Normal file
14
user-agent-rewriter/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# user-agent-rewriter
|
||||
|
||||
## What it does
|
||||
|
||||
This extension uses the webRequest API to rewrite the browser's User Agent header, but only when visiting pages under "http://useragentstring.com/".
|
||||
|
||||
It adds a browser action. The browser action has a popup that lets the user choose one of three browsers: Firefox 41, Chrome 41, and IE 11. When the user chooses a browser, the extension then rewrites the User Agent header so the real browser identifies itself as the chosen browser on the site http://useragentstring.com/.
|
||||
|
||||
## What it shows
|
||||
|
||||
* how to intercept and modify HTTP requests
|
||||
* how to write a browser action with a popup
|
||||
* how to give the popup style and behavior using CSS and JS
|
||||
* how to send a message from a popup script to a background script
|
||||
Reference in New Issue
Block a user