diff --git a/open-my-page-button/README.md b/open-my-page-button/README.md index bfb9033..1f4bbe9 100644 --- a/open-my-page-button/README.md +++ b/open-my-page-button/README.md @@ -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 diff --git a/page-to-extension-messaging/README.md b/page-to-extension-messaging/README.md new file mode 100644 index 0000000..e1c7761 --- /dev/null +++ b/page-to-extension-messaging/README.md @@ -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. diff --git a/tabs-tabs-tabs/README.md b/tabs-tabs-tabs/README.md index 9bacd34..43d3cb5 100644 --- a/tabs-tabs-tabs/README.md +++ b/tabs-tabs-tabs/README.md @@ -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. diff --git a/user-agent-rewriter/README.md b/user-agent-rewriter/README.md new file mode 100644 index 0000000..de0bd80 --- /dev/null +++ b/user-agent-rewriter/README.md @@ -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