diff --git a/apply-css/README.md b/apply-css/README.md
deleted file mode 100644
index c027dde..0000000
--- a/apply-css/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# apply-css
-
-**This add-on injects CSS into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does
-
-This extension includes:
-
-* a background script, "background.js"
-* a page action
-
-It adds the [page action](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/pageAction)
-to every tab the user opens. Clicking the page action
-for a tab applies some CSS using [tabs.insertCSS](https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/tabs/insertCSS).
-
-Clicking again removes the CSS using [tabs.removeCSS](https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/tabs/removeCSS).
-
-## What it shows
-
-* some basic page action functions
-* how to apply and remove CSS.
diff --git a/apply-css/background.js b/apply-css/background.js
deleted file mode 100644
index 7e936a0..0000000
--- a/apply-css/background.js
+++ /dev/null
@@ -1,69 +0,0 @@
-const CSS = "body { border: 20px solid red; }";
-const TITLE_APPLY = "Apply CSS";
-const TITLE_REMOVE = "Remove CSS";
-const APPLICABLE_PROTOCOLS = ["http:", "https:"];
-
-/*
-Toggle CSS: based on the current title, insert or remove the CSS.
-Update the page action's title and icon to reflect its state.
-*/
-function toggleCSS(tab) {
-
- function gotTitle(title) {
- if (title === TITLE_APPLY) {
- browser.pageAction.setIcon({tabId: tab.id, path: "icons/on.svg"});
- browser.pageAction.setTitle({tabId: tab.id, title: TITLE_REMOVE});
- browser.tabs.insertCSS({code: CSS});
- } else {
- browser.pageAction.setIcon({tabId: tab.id, path: "icons/off.svg"});
- browser.pageAction.setTitle({tabId: tab.id, title: TITLE_APPLY});
- browser.tabs.removeCSS({code: CSS});
- }
- }
-
- var gettingTitle = browser.pageAction.getTitle({tabId: tab.id});
- gettingTitle.then(gotTitle);
-}
-
-/*
-Returns true only if the URL's protocol is in APPLICABLE_PROTOCOLS.
-*/
-function protocolIsApplicable(url) {
- var anchor = document.createElement('a');
- anchor.href = url;
- return APPLICABLE_PROTOCOLS.includes(anchor.protocol);
-}
-
-/*
-Initialize the page action: set icon and title, then show.
-Only operates on tabs whose URL's protocol is applicable.
-*/
-function initializePageAction(tab) {
- if (protocolIsApplicable(tab.url)) {
- browser.pageAction.setIcon({tabId: tab.id, path: "icons/off.svg"});
- browser.pageAction.setTitle({tabId: tab.id, title: TITLE_APPLY});
- browser.pageAction.show(tab.id);
- }
-}
-
-/*
-When first loaded, initialize the page action for all tabs.
-*/
-var gettingAllTabs = browser.tabs.query({});
-gettingAllTabs.then((tabs) => {
- for (tab of tabs) {
- initializePageAction(tab);
- }
-});
-
-/*
-Each time a tab is updated, reset the page action for that tab.
-*/
-browser.tabs.onUpdated.addListener((id, changeInfo, tab) => {
- initializePageAction(tab);
-});
-
-/*
-Toggle CSS when the page action is clicked.
-*/
-browser.pageAction.onClicked.addListener(toggleCSS);
diff --git a/apply-css/icons/LICENSE b/apply-css/icons/LICENSE
deleted file mode 100644
index b6c3bc7..0000000
--- a/apply-css/icons/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-These icons are taken from the "Material Design" iconset designed by Google:
-https://google.github.io/material-design-icons/.
diff --git a/apply-css/icons/off.svg b/apply-css/icons/off.svg
deleted file mode 100644
index e54ed1c..0000000
--- a/apply-css/icons/off.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/apply-css/icons/on.svg b/apply-css/icons/on.svg
deleted file mode 100644
index d9a0cb3..0000000
--- a/apply-css/icons/on.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/apply-css/manifest.json b/apply-css/manifest.json
deleted file mode 100644
index f200916..0000000
--- a/apply-css/manifest.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-
- "description": "Adds a page action to toggle applying CSS to pages.",
- "manifest_version": 2,
- "name": "apply-css",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/apply-css",
-
- "background": {
- "scripts": ["background.js"]
- },
-
- "page_action": {
- "default_icon": "icons/off.svg",
- "browser_style": true
- },
-
- "permissions": [
- "activeTab",
- "tabs"
- ]
-
-}
diff --git a/beastify/README.md b/beastify/README.md
deleted file mode 100644
index 941189a..0000000
--- a/beastify/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# beastify
-
-**This add-on injects JavaScript into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does ##
-
-The extension includes:
-
-* a browser action with a popup including HTML, CSS, and JS
-* a content script
-* three images, each of a different beast, packaged as web accessible resources
-
-When the user clicks the browser action button, the popup is shown, enabling
-the user to choose one of three beasts.
-
-When they choose a beast, the extension injects the content script into
-the current page, and sends the content script a message containing
-the name of the chosen beast.
-
-When the content script receives this message, it replaces the current page
-content with an image of the chosen beast.
-
-When the user clicks the reset button, the page reloads, and reverts to its original form.
-
-## What it shows ##
-
-* write a browser action with a popup
-* give the popup style and behavior using CSS and JS
-* inject a content script programmatically using `tabs.executeScript()`
-* send a message from the main extension to a content script
-* use web accessible resources to enable web pages to load packaged content
-* reload web pages
diff --git a/beastify/beasts/frog.jpg b/beastify/beasts/frog.jpg
deleted file mode 100644
index 6ebf852..0000000
Binary files a/beastify/beasts/frog.jpg and /dev/null differ
diff --git a/beastify/beasts/snake.jpg b/beastify/beasts/snake.jpg
deleted file mode 100644
index be459b7..0000000
Binary files a/beastify/beasts/snake.jpg and /dev/null differ
diff --git a/beastify/beasts/turtle.jpg b/beastify/beasts/turtle.jpg
deleted file mode 100644
index 9d62d39..0000000
Binary files a/beastify/beasts/turtle.jpg and /dev/null differ
diff --git a/beastify/content_scripts/beastify.js b/beastify/content_scripts/beastify.js
deleted file mode 100644
index 88f3f71..0000000
--- a/beastify/content_scripts/beastify.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-beastify():
-* removes every node in the document.body,
-* then inserts the chosen beast
-* then removes itself as a listener
-*/
-function beastify(request, sender, sendResponse) {
- removeEverything();
- insertBeast(request.beastURL);
- browser.runtime.onMessage.removeListener(beastify);
-}
-
-/*
-Remove every node under document.body
-*/
-function removeEverything() {
- while (document.body.firstChild) {
- document.body.firstChild.remove();
- }
-}
-
-/*
-Given a URL to a beast image, create and style an IMG node pointing to
-that image, then insert the node into the document.
-*/
-function insertBeast(beastURL) {
- var beastImage = document.createElement("img");
- beastImage.setAttribute("src", beastURL);
- beastImage.setAttribute("style", "width: 100vw");
- beastImage.setAttribute("style", "height: 100vh");
- document.body.appendChild(beastImage);
-}
-
-/*
-Assign beastify() as a listener for messages from the extension.
-*/
-browser.runtime.onMessage.addListener(beastify);
diff --git a/beastify/icons/LICENSE b/beastify/icons/LICENSE
deleted file mode 100644
index 9a206f8..0000000
--- a/beastify/icons/LICENSE
+++ /dev/null
@@ -1,4 +0,0 @@
-
-The icon "beasts-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
-
-The icon "beasts-48.png" is taken from Aha-Soft’s Free Retina iconset, and used under the terms of its license (http://www.aha-soft.com/free-icons/free-retina-icon-set/), with a link back to the website: http://www.aha-soft.com/.
diff --git a/beastify/icons/beasts-32.png b/beastify/icons/beasts-32.png
deleted file mode 100644
index bcf6379..0000000
Binary files a/beastify/icons/beasts-32.png and /dev/null differ
diff --git a/beastify/icons/beasts-48.png b/beastify/icons/beasts-48.png
deleted file mode 100644
index c3f0924..0000000
Binary files a/beastify/icons/beasts-48.png and /dev/null differ
diff --git a/beastify/manifest.json b/beastify/manifest.json
deleted file mode 100644
index e8bf86b..0000000
--- a/beastify/manifest.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-
- "description": "Adds a browser action icon to the toolbar. Click the button to choose a beast. The active tab's body content is then replaced with a picture of the chosen beast. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#beastify",
- "manifest_version": 2,
- "name": "Beastify",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/beastify",
- "icons": {
- "48": "icons/beasts-48.png"
- },
-
- "permissions": [
- "activeTab"
- ],
-
- "browser_action": {
- "default_icon": "icons/beasts-32.png",
- "default_title": "Beastify",
- "default_popup": "popup/choose_beast.html"
- },
-
- "web_accessible_resources": [
- "beasts/frog.jpg",
- "beasts/turtle.jpg",
- "beasts/snake.jpg"
- ]
-
-}
diff --git a/beastify/popup/choose_beast.css b/beastify/popup/choose_beast.css
deleted file mode 100644
index 36c1068..0000000
--- a/beastify/popup/choose_beast.css
+++ /dev/null
@@ -1,27 +0,0 @@
-html, body {
- width: 100px;
-}
-
-.button {
- margin: 3% auto;
- padding: 4px;
- text-align: center;
- font-size: 1.5em;
- cursor: pointer;
-}
-
-.beast:hover {
- background-color: #CFF2F2;
-}
-
-.beast {
- background-color: #E5F2F2;
-}
-
-.clear {
- background-color: #FBFBC9;
-}
-
-.clear:hover {
- background-color: #EAEA9D;
-}
diff --git a/beastify/popup/choose_beast.html b/beastify/popup/choose_beast.html
deleted file mode 100644
index 5984a4e..0000000
--- a/beastify/popup/choose_beast.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
Frog
-
Turtle
-
Snake
-
Reset
-
-
-
-
diff --git a/beastify/popup/choose_beast.js b/beastify/popup/choose_beast.js
deleted file mode 100644
index d70225c..0000000
--- a/beastify/popup/choose_beast.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-Given the name of a beast, get the URL to the corresponding image.
-*/
-function beastNameToURL(beastName) {
- switch (beastName) {
- case "Frog":
- return browser.extension.getURL("beasts/frog.jpg");
- case "Snake":
- return browser.extension.getURL("beasts/snake.jpg");
- case "Turtle":
- return browser.extension.getURL("beasts/turtle.jpg");
- }
-}
-
-/*
-Listen for clicks in the popup.
-
-If the click is on one of the beasts:
- Inject the "beastify.js" content script in the active tab.
-
- Then get the active tab and send "beastify.js" a message
- containing the URL to the chosen beast's image.
-
-If it's on a button wich contains class "clear":
- Reload the page.
- Close the popup. This is needed, as the content script malfunctions after page reloads.
-*/
-document.addEventListener("click", (e) => {
- if (e.target.classList.contains("beast")) {
- var chosenBeast = e.target.textContent;
- var chosenBeastURL = beastNameToURL(chosenBeast);
-
- browser.tabs.executeScript(null, {
- file: "/content_scripts/beastify.js"
- });
-
- var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});
- gettingActiveTab.then((tabs) => {
- browser.tabs.sendMessage(tabs[0].id, {beastURL: chosenBeastURL});
- });
- }
- else if (e.target.classList.contains("clear")) {
- browser.tabs.reload();
- window.close();
-
- return;
- }
-});
diff --git a/bookmark-it/README.md b/bookmark-it/README.md
deleted file mode 100644
index 28c87e0..0000000
--- a/bookmark-it/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# bookmark-it
-
-> This example uses APIs that are available from Firefox 47 onwards.
-
-## What it does
-
-Displays a simple button in the menu bar that toggles a bookmark for the currently active tab.
-
-To display the button, the extension registers a [browserAction](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/browserAction) in the manifest.
-
-A background script will listen for tab events and update the browserAction icon correspondingly. It also listens for `browserAction.onClicked` events to create or remove a bookmark when the user has clicked the icon.
-
-## What it shows
-
-* how to use the various `bookmarks` functions
- * create a bookmark
- * remove a bookmark
- * search bookmarks by url
-* how to register a browserAction
-* how to listen for tab changes
diff --git a/bookmark-it/background.js b/bookmark-it/background.js
deleted file mode 100644
index 171beaf..0000000
--- a/bookmark-it/background.js
+++ /dev/null
@@ -1,69 +0,0 @@
-var currentTab;
-var currentBookmark;
-
-/*
- * Updates the browserAction icon to reflect whether the current page
- * is already bookmarked.
- */
-function updateIcon() {
- browser.browserAction.setIcon({
- path: currentBookmark ? {
- 19: "icons/star-filled-19.png",
- 38: "icons/star-filled-38.png"
- } : {
- 19: "icons/star-empty-19.png",
- 38: "icons/star-empty-38.png"
- },
- tabId: currentTab.id
- });
-}
-
-/*
- * Add or remove the bookmark on the current page.
- */
-function toggleBookmark() {
- if (currentBookmark) {
- browser.bookmarks.remove(currentBookmark.id);
- currentBookmark = null;
- updateIcon();
- } else {
- var creating = browser.bookmarks.create({title: currentTab.title, url: currentTab.url});
- creating.then(function(bookmark) {
- currentBookmark = bookmark;
- updateIcon();
- });
- }
-}
-
-browser.browserAction.onClicked.addListener(toggleBookmark);
-
-/*
- * Switches currentTab and currentBookmark to reflect the currently active tab
- */
-function updateActiveTab(tabs) {
-
- function updateTab(tabs) {
- if (tabs[0]) {
- currentTab = tabs[0];
- var searching = browser.bookmarks.search({url: currentTab.url});
- searching.then((bookmarks) => {
- currentBookmark = bookmarks[0];
- updateIcon();
- });
- }
- }
-
- var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});
- gettingActiveTab.then(updateTab);
-}
-
-// TODO listen for bookmarks.onCreated and bookmarks.onRemoved once Bug 1221764 lands
-
-// listen to tab URL changes
-browser.tabs.onUpdated.addListener(updateActiveTab);
-
-// listen to tab switching
-browser.tabs.onActivated.addListener(updateActiveTab);
-
-// update when the extension loads initially
-updateActiveTab();
diff --git a/bookmark-it/icons/LICENSE b/bookmark-it/icons/LICENSE
deleted file mode 100644
index 4014f4c..0000000
--- a/bookmark-it/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-All images in this folder were created by Johann Hofmann. The creator waives all rights to the images under the CC0 Public Domain Dedication. https://creativecommons.org/publicdomain/zero/1.0/
diff --git a/bookmark-it/icons/bookmark-it.png b/bookmark-it/icons/bookmark-it.png
deleted file mode 100644
index 6b41a93..0000000
Binary files a/bookmark-it/icons/bookmark-it.png and /dev/null differ
diff --git a/bookmark-it/icons/bookmark-it@2x.png b/bookmark-it/icons/bookmark-it@2x.png
deleted file mode 100644
index 95ac86d..0000000
Binary files a/bookmark-it/icons/bookmark-it@2x.png and /dev/null differ
diff --git a/bookmark-it/icons/star-empty-19.png b/bookmark-it/icons/star-empty-19.png
deleted file mode 100644
index 6321a6a..0000000
Binary files a/bookmark-it/icons/star-empty-19.png and /dev/null differ
diff --git a/bookmark-it/icons/star-empty-38.png b/bookmark-it/icons/star-empty-38.png
deleted file mode 100644
index 46a4d71..0000000
Binary files a/bookmark-it/icons/star-empty-38.png and /dev/null differ
diff --git a/bookmark-it/icons/star-filled-19.png b/bookmark-it/icons/star-filled-19.png
deleted file mode 100644
index bee01b9..0000000
Binary files a/bookmark-it/icons/star-filled-19.png and /dev/null differ
diff --git a/bookmark-it/icons/star-filled-38.png b/bookmark-it/icons/star-filled-38.png
deleted file mode 100644
index f8edd21..0000000
Binary files a/bookmark-it/icons/star-filled-38.png and /dev/null differ
diff --git a/bookmark-it/manifest.json b/bookmark-it/manifest.json
deleted file mode 100644
index 06c152c..0000000
--- a/bookmark-it/manifest.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "manifest_version": 2,
- "name": "Bookmark it!",
- "version": "1.0",
- "description": "A simple bookmark button",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/bookmark-it",
- "icons": {
- "48": "icons/bookmark-it.png",
- "96": "icons/bookmark-it@2x.png"
- },
-
- "permissions": [
- "bookmarks",
- "tabs"
- ],
-
- "browser_action": {
- "default_icon": "icons/star-empty-38.png",
- "default_title": "Bookmark it!"
- },
-
- "background": {
- "scripts": ["background.js"]
- }
-
-}
diff --git a/borderify/README.md b/borderify/README.md
deleted file mode 100644
index 1624883..0000000
--- a/borderify/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# borderify
-
-**This add-on injects JavaScript into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does
-
-This extension just includes:
-
-* a content script, "borderify.js", that is injected into any pages
-under "mozilla.org/" or any of its subdomains
-
-The content script draws a border around the document.body.
-
-## What it shows
-
-* how to inject content scripts declaratively using manifest.json
diff --git a/borderify/borderify.js b/borderify/borderify.js
deleted file mode 100644
index fa08e19..0000000
--- a/borderify/borderify.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*
-Just draw a border round the document.body.
-*/
-document.body.style.border = "5px solid red";
diff --git a/borderify/icons/LICENSE b/borderify/icons/LICENSE
deleted file mode 100644
index 9f3eac1..0000000
--- a/borderify/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon “border-48.png” is taken from the Google Material Design iconset, and is used under the terms of the Creative Commons Attribution-ShareAlike license: http://creativecommons.org/licenses/by-sa/3.0/.
diff --git a/borderify/icons/border-48.png b/borderify/icons/border-48.png
deleted file mode 100644
index 90687de..0000000
Binary files a/borderify/icons/border-48.png and /dev/null differ
diff --git a/borderify/manifest.json b/borderify/manifest.json
deleted file mode 100644
index 0c44577..0000000
--- a/borderify/manifest.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-
- "description": "Adds a solid red border to all webpages matching mozilla.org. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#borderify",
- "manifest_version": 2,
- "name": "Borderify",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/borderify",
- "icons": {
- "48": "icons/border-48.png"
- },
-
- "content_scripts": [
- {
- "matches": ["*://*.mozilla.org/*"],
- "js": ["borderify.js"]
- }
- ]
-
-}
diff --git a/build/README.md b/build/README.md
deleted file mode 100644
index bb970aa..0000000
--- a/build/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-This is a built version of most of the extensions in this repository. It excludes:
-
-* webpack-modules: because this one is all about building the module using webpack
-
-Because the extensions mostly have no application id, they can be signed by anyone on addons.mozilla.org. We haven't checked in or stored those ids so you can rebuild them if you'd like. We don't expect end users to be expecting these examples to update automatically (which is what the id is for).
-
-A couple do have ids. You can still sign them yourself by changing the application id. If you'd like to sign them officially and add them to this repo, contact @andymckay or @wbamberg and they can do it for you.
-
-If an extension changes and you'd like to rebuild it, then you should probably update the version number before building it.
-
-To build a new version of the extension use the web-ext sign command, for example:
-
- pushd ../commands/ && web-ext sign --artifacts-dir ../build && popd
diff --git a/build/apply_css-1.0-an+fx.xpi b/build/apply_css-1.0-an+fx.xpi
deleted file mode 100644
index 7830608..0000000
Binary files a/build/apply_css-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/beastify-1.0-an+fx.xpi b/build/beastify-1.0-an+fx.xpi
deleted file mode 100644
index 23a317f..0000000
Binary files a/build/beastify-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/bookmark_it-1.0-an+fx.xpi b/build/bookmark_it-1.0-an+fx.xpi
deleted file mode 100644
index cea19a0..0000000
Binary files a/build/bookmark_it-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/borderify-1.0-an+fx.xpi b/build/borderify-1.0-an+fx.xpi
deleted file mode 100644
index 365ba75..0000000
Binary files a/build/borderify-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/chillout_page_action-1.0-an+fx.xpi b/build/chillout_page_action-1.0-an+fx.xpi
deleted file mode 100644
index a71dd01..0000000
Binary files a/build/chillout_page_action-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/context_menu_demo-1.0-an+fx.xpi b/build/context_menu_demo-1.0-an+fx.xpi
deleted file mode 100644
index 4fd3d23..0000000
Binary files a/build/context_menu_demo-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/cookie_bg_picker-1.0-an+fx.xpi b/build/cookie_bg_picker-1.0-an+fx.xpi
deleted file mode 100644
index 24abd96..0000000
Binary files a/build/cookie_bg_picker-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/emoji_substitution-1.0-an+fx.xpi b/build/emoji_substitution-1.0-an+fx.xpi
deleted file mode 100644
index 3e1a2c8..0000000
Binary files a/build/emoji_substitution-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/eslint_example-1.0-an+fx.xpi b/build/eslint_example-1.0-an+fx.xpi
deleted file mode 100644
index 2388674..0000000
Binary files a/build/eslint_example-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/favourite_colour-1.0-an+fx.xpi b/build/favourite_colour-1.0-an+fx.xpi
deleted file mode 100644
index 3b10bae..0000000
Binary files a/build/favourite_colour-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/history_deleter-1.0-an+fx.xpi b/build/history_deleter-1.0-an+fx.xpi
deleted file mode 100644
index 080423c..0000000
Binary files a/build/history_deleter-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/latest_download-1.0-an+fx.xpi b/build/latest_download-1.0-an+fx.xpi
deleted file mode 100644
index 68d2f3c..0000000
Binary files a/build/latest_download-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/list_cookies-1.0-an+fx.xpi b/build/list_cookies-1.0-an+fx.xpi
deleted file mode 100644
index a34037a..0000000
Binary files a/build/list_cookies-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/navigation_stats-0.1.0-an+fx.xpi b/build/navigation_stats-0.1.0-an+fx.xpi
deleted file mode 100644
index c62dc93..0000000
Binary files a/build/navigation_stats-0.1.0-an+fx.xpi and /dev/null differ
diff --git a/build/notify_link_clicks_i18n-1.0-an+fx.xpi b/build/notify_link_clicks_i18n-1.0-an+fx.xpi
deleted file mode 100644
index 596b053..0000000
Binary files a/build/notify_link_clicks_i18n-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/open_my_page-1.0-an+fx.xpi b/build/open_my_page-1.0-an+fx.xpi
deleted file mode 100644
index 9f7bcfd..0000000
Binary files a/build/open_my_page-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/page_to_extension_messaging-1.0-an+fx.xpi b/build/page_to_extension_messaging-1.0-an+fx.xpi
deleted file mode 100644
index 476532f..0000000
Binary files a/build/page_to_extension_messaging-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/page_to_extension_messaging-1.0-fx.xpi b/build/page_to_extension_messaging-1.0-fx.xpi
deleted file mode 100644
index c73a004..0000000
Binary files a/build/page_to_extension_messaging-1.0-fx.xpi and /dev/null differ
diff --git a/build/quicknote-1.0-an+fx.xpi b/build/quicknote-1.0-an+fx.xpi
deleted file mode 100644
index 36de373..0000000
Binary files a/build/quicknote-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/sample_commands_extension-1.0-an+fx.xpi b/build/sample_commands_extension-1.0-an+fx.xpi
deleted file mode 100644
index 9ed7873..0000000
Binary files a/build/sample_commands_extension-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/sample_commands_extension-1.0-fx.xpi b/build/sample_commands_extension-1.0-fx.xpi
deleted file mode 100644
index c604b5a..0000000
Binary files a/build/sample_commands_extension-1.0-fx.xpi and /dev/null differ
diff --git a/build/selection_to_clipboard-1.0-an+fx.xpi b/build/selection_to_clipboard-1.0-an+fx.xpi
deleted file mode 100644
index b413272..0000000
Binary files a/build/selection_to_clipboard-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/tab_strip-1.0-an+fx.xpi b/build/tab_strip-1.0-an+fx.xpi
deleted file mode 100644
index 60e3786..0000000
Binary files a/build/tab_strip-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/tabs_tabs_tabs-1.0-an+fx.xpi b/build/tabs_tabs_tabs-1.0-an+fx.xpi
deleted file mode 100644
index e913c2f..0000000
Binary files a/build/tabs_tabs_tabs-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/user_agent_rewriter-1.0-an+fx.xpi b/build/user_agent_rewriter-1.0-an+fx.xpi
deleted file mode 100644
index 4385855..0000000
Binary files a/build/user_agent_rewriter-1.0-an+fx.xpi and /dev/null differ
diff --git a/build/window_manipulator-1.0-an+fx.xpi b/build/window_manipulator-1.0-an+fx.xpi
deleted file mode 100644
index 04350e3..0000000
Binary files a/build/window_manipulator-1.0-an+fx.xpi and /dev/null differ
diff --git a/chill-out/README.md b/chill-out/README.md
deleted file mode 100644
index 5332e13..0000000
--- a/chill-out/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# chill-out
-
-## What it does
-
-After N seconds of inactivity (defined as the user not having navigated
-or switched away from the active tab) display a
-[page action](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/pageAction)
-for that tab.
-
-When the user clicks the page action,
-navigate to http://chilloutandwatchsomecatgifs.com/.
-
-"N" is set to 6 seconds in this example. Such a short period is chosen to make
-the extension's behavior more obvious, but this is not recommended in real life.
-Note that in Chrome, alarms cannot be set for less than a minute. In Chrome:
-
-* if you install this extension "unpacked", you'll see a warning
-in the console, but the alarm will still go off after 6 seconds
-* if you package the extension and install it, then the alarm will go off after
-a minute.
-
-## What it shows
-
-* how to use various `tabs` functions
-* how to show/hide a page action
-* how to set alarms and handle alarms going off
diff --git a/chill-out/background.js b/chill-out/background.js
deleted file mode 100644
index bbf453f..0000000
--- a/chill-out/background.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-DELAY is set to 6 seconds in this example. Such a short period is chosen to make
-the extension's behavior more obvious, but this is not recommended in real life.
-Note that in Chrome, alarms cannot be set for less than a minute. In Chrome:
-
-* if you install this extension "unpacked", you'll see a warning
-in the console, but the alarm will still go off after 6 seconds
-* if you package the extension and install it, then the alarm will go off after
-a minute.
-*/
-var DELAY = 0.1;
-var CATGIFS = "http://chilloutandwatchsomecatgifs.com/";
-
-/*
-Restart alarm for the currently active tab, whenever background.js is run.
-*/
-var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});
-gettingActiveTab.then((tabs) => {
- restartAlarm(tabs[0].id);
-});
-
-/*
-Restart alarm for the currently active tab, whenever the user navigates.
-*/
-browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
- if (!changeInfo.url) {
- return;
- }
- var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});
- gettingActiveTab.then((tabs) => {
- if (tabId == tabs[0].id) {
- restartAlarm(tabId);
- }
- });
-});
-
-/*
-Restart alarm for the currently active tab, whenever a new tab becomes active.
-*/
-browser.tabs.onActivated.addListener((activeInfo) => {
- restartAlarm(activeInfo.tabId);
-});
-
-/*
-restartAlarm: clear all alarms,
-then set a new alarm for the given tab.
-*/
-function restartAlarm(tabId) {
- browser.pageAction.hide(tabId);
- browser.alarms.clearAll();
- var gettingTab = browser.tabs.get(tabId);
- gettingTab.then((tab) => {
- if (tab.url != CATGIFS) {
- browser.alarms.create("", {delayInMinutes: DELAY});
- }
- });
-}
-
-/*
-On alarm, show the page action.
-*/
-browser.alarms.onAlarm.addListener((alarm) => {
- var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});
- gettingActiveTab.then((tabs) => {
- browser.pageAction.show(tabs[0].id);
- });
-});
-
-/*
-On page action click, navigate the corresponding tab to the cat gifs.
-*/
-browser.pageAction.onClicked.addListener(function () {
- browser.tabs.update({url: CATGIFS});
-});
diff --git a/chill-out/icons/LICENSE b/chill-out/icons/LICENSE
deleted file mode 100644
index 2294057..0000000
--- a/chill-out/icons/LICENSE
+++ /dev/null
@@ -1,3 +0,0 @@
-The icon "chillout-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
-
-The icon "chillout-48.png" is taken from Aha-Soft’s Free Retina iconset, and used under the terms of its license (http://www.aha-soft.com/free-icons/free-retina-icon-set/), with a link back to the website: http://www.aha-soft.com/.
diff --git a/chill-out/icons/chillout-32.png b/chill-out/icons/chillout-32.png
deleted file mode 100644
index bcf6379..0000000
Binary files a/chill-out/icons/chillout-32.png and /dev/null differ
diff --git a/chill-out/icons/chillout-48.png b/chill-out/icons/chillout-48.png
deleted file mode 100644
index dc456e5..0000000
Binary files a/chill-out/icons/chillout-48.png and /dev/null differ
diff --git a/chill-out/manifest.json b/chill-out/manifest.json
deleted file mode 100644
index 13bc042..0000000
--- a/chill-out/manifest.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "manifest_version": 2,
- "name": "chillout-page-action",
- "version": "1.0",
- "description": "Show a page action after a period of inactivity. Show cat gifs when the page action is clicked.",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/chill-out",
- "icons": {
- "48": "icons/chillout-48.png"
- },
-
- "permissions": [
- "alarms",
- "tabs"
- ],
-
- "page_action": {
- "default_icon": "icons/chillout-32.png",
- "default_title": "Chill out"
- },
-
- "background": {
- "scripts": ["background.js"]
- }
-
-}
diff --git a/commands/README.md b/commands/README.md
deleted file mode 100644
index 9cb9cc8..0000000
--- a/commands/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# commands
-
-This extension includes:
-
-* a background script, "background.js"
-
-All it does is:
-
-* register a shortcut (Ctrl+Shift+U) to send a command to the extension (Command+Shift+U on a Mac).",
-
-It shows:
-
-* how to use chrome.commands to register keyboard shortcuts for your extension.
diff --git a/commands/background.js b/commands/background.js
deleted file mode 100644
index 825c559..0000000
--- a/commands/background.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Returns all of the registered extension commands for this extension
- * and their shortcut (if active).
- *
- * Since there is only one registered command in this sample extension,
- * the returned `commandsArray` will look like the following:
- * [{
- * name: "toggle-feature",
- * description: "Send a 'toggle-feature' event to the extension"
- * shortcut: "Ctrl+Shift+U"
- * }]
- */
-var gettingAllCommands = browser.commands.getAll();
-gettingAllCommands.then((commands) => {
- for (command of commands) {
- console.log(command);
- }
-});
-
-/**
- * Fired when a registered command is activated using a keyboard shortcut.
- *
- * In this sample extension, there is only one registered command: "Ctrl+Shift+U".
- * On Mac, this command will automatically be converted to "Command+Shift+U".
- */
-browser.commands.onCommand.addListener((command) => {
- console.log("onCommand event received for message: ", command);
-});
diff --git a/commands/manifest.json b/commands/manifest.json
deleted file mode 100644
index 785b9f0..0000000
--- a/commands/manifest.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "Sample Commands Extension",
- "description": "Press Ctrl+Shift+U to send an event (Command+Shift+U on a Mac).",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/commands",
- "manifest_version": 2,
- "version": "1.0",
- "background": {
- "scripts": ["background.js"]
- },
-
- "commands": {
- "toggle-feature": {
- "suggested_key": { "default": "Ctrl+Shift+U" },
- "description": "Send a 'toggle-feature' event to the extension"
- }
- }
-}
diff --git a/context-menu-demo/README.md b/context-menu-demo/README.md
deleted file mode 100644
index c8b301c..0000000
--- a/context-menu-demo/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# context-menu-demo
-
-A demo of the [contextMenus API](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextMenus/).
-
-**This add-on injects JavaScript into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does
-
-This add-on adds several items to the browser's context menu:
-
-* one shown when there is a selection in the page, that logs the selected text
-to the browser console when clicked.
-* one shown in all contexts, that is removed when clicked.
-* two "radio" items that are shown in all contexts.
-These items are grouped using a separator item on each side.
-One radio item adds a blue border to the page, the other adds a green border.
-Note that these buttons only work on normal web pages, not special pages
-like about:debugging.
-* one "checkbox" item, shown in all contexts, whose title is updated when the
-item is clicked.
-
-## What it shows
-
-* How to create various types of context menu item:
- * normal
- * radio
- * separator
- * checkbox
-* How to use contexts to control when an item appears.
-* How to update an item's properties.
-* How to remove an item.
diff --git a/context-menu-demo/_locales/en/messages.json b/context-menu-demo/_locales/en/messages.json
deleted file mode 100644
index d4022f3..0000000
--- a/context-menu-demo/_locales/en/messages.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "extensionName": {
- "message": "Context menu demo",
- "description": "Name of the extension."
- },
-
- "extensionDescription": {
- "message": "Demonstrates the contextMenus API.",
- "description": "Description of the add-on."
- },
-
- "contextMenuItemSelectionLogger": {
- "message": "Log '%s' to the browser console",
- "description": "Title of context menu item that logs the selected text when clicked."
- },
-
- "contextMenuItemRemoveMe": {
- "message": "Remove me!",
- "description": "Title of context menu item that removes itself when clicked."
- },
-
- "contextMenuItemGreenify": {
- "message": "Greenify",
- "description": "Title of context menu item that adds a green border when clicked."
- },
-
- "contextMenuItemBluify": {
- "message": "Bluify",
- "description": "Title of context menu item that adds a green border when clicked."
- },
-
- "contextMenuItemCheckMe": {
- "message": "Check me",
- "description": "Title of context menu item when the item is checked."
- },
-
- "contextMenuItemUncheckMe": {
- "message": "Uncheck me",
- "description": "Title of context menu item when the item is unchecked."
- }
-
-}
diff --git a/context-menu-demo/background.js b/context-menu-demo/background.js
deleted file mode 100644
index a52e33c..0000000
--- a/context-menu-demo/background.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-Called when the item has been created, or when creation failed due to an error.
-We'll just log success/failure here.
-*/
-function onCreated(n) {
- if (browser.runtime.lastError) {
- console.log(`Error: ${browser.runtime.lastError}`);
- } else {
- console.log("Item created successfully");
- }
-}
-
-/*
-Called when the item has been removed.
-We'll just log success here.
-*/
-function onRemoved() {
- console.log("Item removed successfully");
-}
-
-/*
-Called when there was an error.
-We'll just log the error here.
-*/
-function onError(error) {
- console.log(`Error: ${error}`);
-}
-
-/*
-Create all the context menu items.
-*/
-browser.contextMenus.create({
- id: "log-selection",
- title: browser.i18n.getMessage("contextMenuItemSelectionLogger"),
- contexts: ["selection"]
-}, onCreated);
-
-browser.contextMenus.create({
- id: "remove-me",
- title: browser.i18n.getMessage("contextMenuItemRemoveMe"),
- contexts: ["all"]
-}, onCreated);
-
-browser.contextMenus.create({
- id: "separator-1",
- type: "separator",
- contexts: ["all"]
-}, onCreated);
-
-browser.contextMenus.create({
- id: "greenify",
- type: "radio",
- title: browser.i18n.getMessage("contextMenuItemGreenify"),
- contexts: ["all"],
- checked: true
-}, onCreated);
-
-browser.contextMenus.create({
- id: "bluify",
- type: "radio",
- title: browser.i18n.getMessage("contextMenuItemBluify"),
- contexts: ["all"],
- checked: false
-}, onCreated);
-
-browser.contextMenus.create({
- id: "separator-2",
- type: "separator",
- contexts: ["all"]
-}, onCreated);
-
-var checkedState = true;
-
-browser.contextMenus.create({
- id: "check-uncheck",
- type: "checkbox",
- title: browser.i18n.getMessage("contextMenuItemUncheckMe"),
- contexts: ["all"],
- checked: checkedState
-}, onCreated);
-
-/*
-Set a colored border on the document in the given tab.
-
-Note that this only work on normal web pages, not special pages
-like about:debugging.
-*/
-var blue = 'document.body.style.border = "5px solid blue"';
-var green = 'document.body.style.border = "5px solid green"';
-
-function borderify(tabId, color) {
- browser.tabs.executeScript(tabId, {
- code: color
- });
-}
-
-/*
-Toggle checkedState, and update the menu item's title
-appropriately.
-
-Note that we should not have to maintain checkedState independently like
-this, but have to because Firefox does not currently pass the "checked"
-property into the event listener.
-*/
-function updateCheckUncheck() {
- checkedState = !checkedState;
- if (checkedState) {
- browser.contextMenus.update("check-uncheck", {
- title: browser.i18n.getMessage("contextMenuItemUncheckMe"),
- });
- } else {
- browser.contextMenus.update("check-uncheck", {
- title: browser.i18n.getMessage("contextMenuItemCheckMe"),
- });
- }
-}
-
-/*
-The click event listener, where we perform the appropriate action given the
-ID of the menu item that was clicked.
-*/
-browser.contextMenus.onClicked.addListener(function(info, tab) {
- switch (info.menuItemId) {
- case "log-selection":
- console.log(info.selectionText);
- break;
- case "remove-me":
- var removing = browser.contextMenus.remove(info.menuItemId);
- removing.then(onRemoved, onError);
- break;
- case "bluify":
- borderify(tab.id, blue);
- break;
- case "greenify":
- borderify(tab.id, green);
- break;
- case "check-uncheck":
- updateCheckUncheck();
- break;
- }
-});
diff --git a/context-menu-demo/icons/LICENSE b/context-menu-demo/icons/LICENSE
deleted file mode 100644
index 20e821d..0000000
--- a/context-menu-demo/icons/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-
-The "page-32.png" and "page-48.png" icons are taken from the miu iconset created by Linh Pham Thi Dieu, and are used under the terms of its license: http://linhpham.me/miu/.
diff --git a/context-menu-demo/icons/page-16.png b/context-menu-demo/icons/page-16.png
deleted file mode 100644
index a6fed5c..0000000
Binary files a/context-menu-demo/icons/page-16.png and /dev/null differ
diff --git a/context-menu-demo/icons/page-32.png b/context-menu-demo/icons/page-32.png
deleted file mode 100644
index dae663d..0000000
Binary files a/context-menu-demo/icons/page-32.png and /dev/null differ
diff --git a/context-menu-demo/icons/page-48.png b/context-menu-demo/icons/page-48.png
deleted file mode 100644
index ba042cd..0000000
Binary files a/context-menu-demo/icons/page-48.png and /dev/null differ
diff --git a/context-menu-demo/manifest.json b/context-menu-demo/manifest.json
deleted file mode 100644
index fcf76ac..0000000
--- a/context-menu-demo/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-
- "manifest_version": 2,
- "name": "__MSG_extensionName__",
- "description": "__MSG_extensionDescription__",
- "version": "1.0",
- "default_locale": "en",
-
- "background": {
- "scripts": ["background.js"]
- },
-
- "permissions": [
- "contextMenus",
- "activeTab"
- ],
-
- "icons": {
- "16": "icons/page-16.png",
- "32": "icons/page-32.png",
- "48": "icons/page-48.png"
- }
-
-}
diff --git a/cookie-bg-picker/README.md b/cookie-bg-picker/README.md
deleted file mode 100644
index 598f83e..0000000
--- a/cookie-bg-picker/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Cookie BG Picker
-A background customizer WebExtension — click a button in the browser UI and select from a range of background image tiles and colors to customize the look of any web page you are on.
-
-The WebExtension also uses cookies to save preferences for each site you customize, provided the cookie is able to be saved. On your return, your customizations will be remembered.
-
-Works in Firefox 47+, and will also work as a Chrome extension, out of the box.
-
-**This add-on injects JavaScript into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does
-
-This extension includes:
-
-* A browser action that creates a popup — within the popup is:
- * Several buttons to select different background images.
- * A color picker input element to select a new background color.
- * A reset button to remove any customizations that have been set.
- * Functions to save customization preferences into cookies for each site visited and customized.
- * Functions to send messages to the content script (see below) containing style information so that style customizations can be applied to the pages.
-* A background script to retrieve any cookies previously set by the WebExtension for each page visited, and if so send messages to the content script (see below) containing style information so that previously saved style customizations can be applied to pages as soon as they are visited in the browser. The background script also injects the content script into each page visited.
-* A content script that is injected into every page visited. Its function is to receive messages from the browser action and background scripts and apply the style information contained within to the current page.
-
-
-Cookie BG Picker uses the WebExtension:
-
-* [cookies API](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/cookies) to save/retrieve/remove the cookies.
-* [tabs API](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs) to retrieve information about the current tab (whenever a new URL is loaded and at each significant point thereafter), inject the content script into it, and to send messages between the browser action/background script and the content script.
-* [runtime API](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime) to receive and handle messages sent to the content script.
-
-## What it shows
-
-* How to persist data via cookies using a WebExtension.
-* How to send messages between browser actions/background scripts and content scripts.
-
-## Acknowledgements
-
-* WebExtension icon courtesy of [icons8.com](http://icons8.com).
-* Transparent background images taken from [Transparent Textures](https://www.transparenttextures.com/).
diff --git a/cookie-bg-picker/background_scripts/background.js b/cookie-bg-picker/background_scripts/background.js
deleted file mode 100644
index fb0640a..0000000
--- a/cookie-bg-picker/background_scripts/background.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Retrieve any previously set cookie and send to content script */
-
-browser.tabs.onUpdated.addListener(cookieUpdate);
-
-function getActiveTab() {
- return browser.tabs.query({active: true, currentWindow: true});
-}
-
-function cookieUpdate(tabId, changeInfo, tab) {
- getActiveTab().then((tabs) => {
- /* inject content script into current tab */
-
- browser.tabs.executeScript(null, {
- file: "/content_scripts/updatebg.js"
- });
-
- // get any previously set cookie for the current tab
- var gettingCookies = browser.cookies.get({
- url: tabs[0].url,
- name: "bgpicker"
- });
- gettingCookies.then((cookie) => {
- if(cookie) {
- var cookieVal = JSON.parse(cookie.value);
- browser.tabs.sendMessage(tabs[0].id, {image: cookieVal.image});
- browser.tabs.sendMessage(tabs[0].id, {color: cookieVal.color});
- }
- });
- });
-}
diff --git a/cookie-bg-picker/content_scripts/updatebg.js b/cookie-bg-picker/content_scripts/updatebg.js
deleted file mode 100644
index f3bd6be..0000000
--- a/cookie-bg-picker/content_scripts/updatebg.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var html = document.querySelector('html');
-var body = document.querySelector('body');
-
-browser.runtime.onMessage.addListener(updateBg);
-
-function updateBg(request, sender, sendResponse) {
- if(request.image) {
- html.style.backgroundImage = 'url(' + request.image + ')';
- body.style.backgroundImage = 'url(' + request.image + ')';
- } else if(request.color) {
- html.style.backgroundColor = request.color;
- body.style.backgroundColor = request.color;
- } else if (request.reset) {
- html.style.backgroundImage = '';
- html.style.backgroundColor = '';
- body.style.backgroundImage = '';
- body.style.backgroundColor = '';
- }
-}
diff --git a/cookie-bg-picker/icons/bgpicker-32.png b/cookie-bg-picker/icons/bgpicker-32.png
deleted file mode 100644
index 5889126..0000000
Binary files a/cookie-bg-picker/icons/bgpicker-32.png and /dev/null differ
diff --git a/cookie-bg-picker/icons/bgpicker-48.png b/cookie-bg-picker/icons/bgpicker-48.png
deleted file mode 100644
index ec51b34..0000000
Binary files a/cookie-bg-picker/icons/bgpicker-48.png and /dev/null differ
diff --git a/cookie-bg-picker/manifest.json b/cookie-bg-picker/manifest.json
deleted file mode 100644
index 4e5c915..0000000
--- a/cookie-bg-picker/manifest.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
-
- "manifest_version": 2,
- "name": "Cookie BG Picker",
- "version": "1.0",
-
- "description": "Allows the user to customize the background color and pattern of their sites. Also saves their preferences via cookies where possible.",
- "icons": {
- "48": "icons/bgpicker-48.png"
- },
-
- "permissions": [
- "tabs",
- "cookies",
- ""
- ],
-
- "web_accessible_resources": [
- "popup/images/bullseyes.png",
- "popup/images/starring.png",
- "popup/images/subtle.png",
- "popup/images/tactilenoise.png",
- "popup/images/triangles.png",
- "popup/images/triangles2.png",
- "popup/images/washi.png",
- "popup/images/whitey.png"
- ],
-
- "browser_action": {
- "default_icon": {
- "32" : "icons/bgpicker-32.png"
- },
- "default_title": "BG Picker",
- "default_popup": "popup/bgpicker.html"
- },
-
- "background": {
- "scripts": ["background_scripts/background.js"]
- }
-}
diff --git a/cookie-bg-picker/popup/bgpicker.css b/cookie-bg-picker/popup/bgpicker.css
deleted file mode 100644
index d69f89a..0000000
--- a/cookie-bg-picker/popup/bgpicker.css
+++ /dev/null
@@ -1,39 +0,0 @@
-/* General styling */
-
-* {
- box-sizing: border-box;
-}
-
-html {
- font-family: sans-serif;
- font-size: 10px;
- background: rgb(150,150,150);
- height: 88px;
- margin: 0;
-}
-
-body {
- width: 208px;
- margin: 0 auto;
- height: inherit;
-}
-
-.bg-container button {
- display: inline-block;
- width: 50px;
- height: 30px;
- margin: 1px;
-}
-
-.color-reset {
- width: 208px;
- height: 20px;
-}
-
-input, .color-reset button {
- display: block;
- width: 48%;
- height: 110%;
- float: left;
- margin: 0 1% 1% 1%;
-}
\ No newline at end of file
diff --git a/cookie-bg-picker/popup/bgpicker.html b/cookie-bg-picker/popup/bgpicker.html
deleted file mode 100644
index 96e41d2..0000000
--- a/cookie-bg-picker/popup/bgpicker.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cookie-bg-picker/popup/bgpicker.js b/cookie-bg-picker/popup/bgpicker.js
deleted file mode 100644
index 987c61f..0000000
--- a/cookie-bg-picker/popup/bgpicker.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* initialise variables */
-
-var bgBtns = document.querySelectorAll('.bg-container button');
-var colorPick = document.querySelector('input');
-var reset = document.querySelector('.color-reset button');
-var cookieVal = { image : '',
- color : '' };
-
-function getActiveTab() {
- return browser.tabs.query({active: true, currentWindow: true});
-}
-
-/* apply backgrounds to buttons */
-/* add listener so that when clicked, button applies background to page HTML */
-
-for(var i = 0; i < bgBtns.length; i++) {
- var imgName = bgBtns[i].getAttribute('class');
- var bgImg = 'url(\'images/' + imgName + '.png\')';
- bgBtns[i].style.backgroundImage = bgImg;
-
- bgBtns[i].onclick = function(e) {
- getActiveTab().then((tabs) => {
- var imgName = e.target.getAttribute('class');
- var fullURL = browser.extension.getURL('popup/images/'+ imgName + '.png');
- browser.tabs.sendMessage(tabs[0].id, {image: fullURL});
-
- cookieVal.image = fullURL;
- browser.cookies.set({
- url: tabs[0].url,
- name: "bgpicker",
- value: JSON.stringify(cookieVal)
- })
- });
- }
-}
-
-/* apply chosen color to HTML background */
-
-colorPick.onchange = function(e) {
- getActiveTab().then((tabs) => {
- var currColor = e.target.value;
- browser.tabs.sendMessage(tabs[0].id, {color: currColor});
-
- cookieVal.color = currColor;
- browser.cookies.set({
- url: tabs[0].url,
- name: "bgpicker",
- value: JSON.stringify(cookieVal)
- })
- });
-}
-
-/* reset background */
-
-reset.onclick = function() {
- getActiveTab().then((tabs) => {
- browser.tabs.sendMessage(tabs[0].id, {reset: true});
-
- cookieVal = { image : '',
- color : '' };
- browser.cookies.remove({
- url: tabs[0].url,
- name: "bgpicker"
- })
- });
-}
-
-/* Report cookie changes to the console */
-
-browser.cookies.onChanged.addListener((changeInfo) => {
- console.log(`Cookie changed:\n
- * Cookie: ${JSON.stringify(changeInfo.cookie)}\n
- * Cause: ${changeInfo.cause}\n
- * Removed: ${changeInfo.removed}`);
-});
diff --git a/cookie-bg-picker/popup/images/bullseyes.png b/cookie-bg-picker/popup/images/bullseyes.png
deleted file mode 100644
index cd38bcc..0000000
Binary files a/cookie-bg-picker/popup/images/bullseyes.png and /dev/null differ
diff --git a/cookie-bg-picker/popup/images/starring.png b/cookie-bg-picker/popup/images/starring.png
deleted file mode 100644
index a4f657c..0000000
Binary files a/cookie-bg-picker/popup/images/starring.png and /dev/null differ
diff --git a/cookie-bg-picker/popup/images/subtle.png b/cookie-bg-picker/popup/images/subtle.png
deleted file mode 100644
index f1c1cb8..0000000
Binary files a/cookie-bg-picker/popup/images/subtle.png and /dev/null differ
diff --git a/cookie-bg-picker/popup/images/tactilenoise.png b/cookie-bg-picker/popup/images/tactilenoise.png
deleted file mode 100644
index 86b64e4..0000000
Binary files a/cookie-bg-picker/popup/images/tactilenoise.png and /dev/null differ
diff --git a/cookie-bg-picker/popup/images/triangles.png b/cookie-bg-picker/popup/images/triangles.png
deleted file mode 100644
index a5b7a27..0000000
Binary files a/cookie-bg-picker/popup/images/triangles.png and /dev/null differ
diff --git a/cookie-bg-picker/popup/images/triangles2.png b/cookie-bg-picker/popup/images/triangles2.png
deleted file mode 100644
index e24590c..0000000
Binary files a/cookie-bg-picker/popup/images/triangles2.png and /dev/null differ
diff --git a/cookie-bg-picker/popup/images/washi.png b/cookie-bg-picker/popup/images/washi.png
deleted file mode 100644
index 5d3f25d..0000000
Binary files a/cookie-bg-picker/popup/images/washi.png and /dev/null differ
diff --git a/cookie-bg-picker/popup/images/whitey.png b/cookie-bg-picker/popup/images/whitey.png
deleted file mode 100644
index dd660f3..0000000
Binary files a/cookie-bg-picker/popup/images/whitey.png and /dev/null differ
diff --git a/embedded-webextension-bootstrapped/README.md b/embedded-webextension-bootstrapped/README.md
deleted file mode 100644
index 85c5c9f..0000000
--- a/embedded-webextension-bootstrapped/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-This is an example of how to use [embedded WebExtensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Embedded_WebExtensions) to convert a legacy [Bootstrapped extension](https://developer.mozilla.org/en-US/Add-ons/Bootstrapped_extensions) to a [WebExtension](https://developer.mozilla.org/en-US/Add-ons/WebExtensions) in stages, and migrate the legacy add-on's data so it's accessible by the WebExtension.
-
-The legacy add-on contains:
-
-- some user data stored in the Firefox preferences
-- a button in the toolbar
-
-When the button is pressed, the add-on displays a panel containing the stored data.
-
-This directory contains three versions of the add-on.
-
-- **step0-legacy-addon**: the initial add-on, written entirely using the bootstrapped extension method.
-- **step1-hybrid-addon**: a hybrid consisting of a bootstrapped extension containing an embedded WebExtension. The bootstrapped extension reads the stored data and sends it to the embedded WebExtension. The embedded WebExtension stores the data using the [`storage`](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage) API, and also implements the UI.
-- **step2-pure-webextension**: the final version, written entirely using the WebExtensions method. This version can be deployed after the hybrid version has migrated the stored data to the `storage` API.
diff --git a/embedded-webextension-bootstrapped/step0-legacy-addon/bootstrap.js b/embedded-webextension-bootstrapped/step0-legacy-addon/bootstrap.js
deleted file mode 100644
index 364394a..0000000
--- a/embedded-webextension-bootstrapped/step0-legacy-addon/bootstrap.js
+++ /dev/null
@@ -1,16 +0,0 @@
-"use strict";
-
-function startup(data) {
- Components.utils.import("chrome://original-bootstrap-addon-id/content/AddonPrefs.jsm");
- Components.utils.import("chrome://original-bootstrap-addon-id/content/AddonUI.jsm");
-
- AddonPrefs.set("super-important-user-setting", "char", "addon preference content");
- AddonUI.init(data);
-}
-
-function shutdown(data) {
- AddonUI.shutdown(data);
-
- Components.utils.unload("chrome://original-bootstrap-addon-id/content/AddonUI.jsm");
- Components.utils.unload("chrome://original-bootstrap-addon-id/content/AddonPrefs.jsm");
-}
diff --git a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome.manifest b/embedded-webextension-bootstrapped/step0-legacy-addon/chrome.manifest
deleted file mode 100644
index abbe1db..0000000
--- a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content original-bootstrap-addon-id chrome/
\ No newline at end of file
diff --git a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/AddonPrefs.jsm b/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/AddonPrefs.jsm
deleted file mode 100644
index 2d4d3cf..0000000
--- a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/AddonPrefs.jsm
+++ /dev/null
@@ -1,41 +0,0 @@
-"use strict";
-
-var EXPORTED_SYMBOLS = ["AddonPrefs"];
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-const BASE_PREF = "extensions.original-bootstrap-addon-id.";
-
-function get(key, type = "char") {
- key = BASE_PREF + key;
-
- switch(type) {
- case "char":
- return Services.prefs.getCharPref(key);
- case "bool":
- return Services.prefs.getBoolPref(key);
- case "int":
- return Services.prefs.getIntPref(key);
- }
-
- throw new Error(`Unknown type: ${type}`);
-}
-
-function set(key, type, value) {
- key = BASE_PREF + key;
-
- switch(type) {
- case "char":
- return Services.prefs.setCharPref(key, value);
- case "bool":
- return Services.prefs.setBoolPref(key, value);
- case "int":
- return Services.prefs.setIntPref(key, value);
- }
-
- throw new Error(`Unknown type: ${type}`);
-}
-
-var AddonPrefs = {
- get, set,
-};
diff --git a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/AddonUI.jsm b/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/AddonUI.jsm
deleted file mode 100644
index e014a7c..0000000
--- a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/AddonUI.jsm
+++ /dev/null
@@ -1,65 +0,0 @@
-"use strict";
-
-var EXPORTED_SYMBOLS = ["AddonUI"];
-
-Components.utils.import("resource:///modules/CustomizableUI.jsm");
-
-Components.utils.import("chrome://original-bootstrap-addon-id/content/AddonPrefs.jsm");
-
-const BUTTON_ID = "original-bootstrap-addon-id--toolbar-button";
-const BUTTON_ICON_URL = "chrome://original-bootstrap-addon-id/content/icons/icon-32.png";
-
-const PANEL_ID = "original-bootstrap-addon-id--popup-panel";
-
-function createPanel(node) {
- var doc = node.ownerDocument;
-
- var panel = doc.createElement("panel");
- panel.setAttribute("type", "arrow");
- panel.setAttribute("id", PANEL_ID);
- panel.setAttribute("flip", "slide");
- panel.setAttribute("hidden", true);
- panel.setAttribute("position", "bottomcenter topright");
- var panelContent = doc.createElement("label");
- panelContent.textContent = AddonPrefs.get("super-important-user-setting");
- panel.appendChild(panelContent);
-
- return panel;
-}
-
-function defineButtonWidget() {
- let buttonDef = {
- id : BUTTON_ID,
- type : "button",
- defaultArea : CustomizableUI.AREA_NAVBAR,
- label : "button label",
- tooltiptext : "button tooltip",
- onCreated : function (node) {
- node.setAttribute('image', BUTTON_ICON_URL);
-
- const panel = createPanel(node);
- node.appendChild(panel);
-
- node.addEventListener("click", () => {
- panel.setAttribute("hidden", false);
- panel.openPopup(node, panel.getAttribute("position"), 0, 0, false, false);
- });
- }
- };
-
- CustomizableUI.createWidget(buttonDef);
-};
-
-
-
-function init({id}) {
- defineButtonWidget(BUTTON_ID);
-}
-
-function shutdown({id}) {
- CustomizableUI.destroyWidget(BUTTON_ID);
-}
-
-var AddonUI = {
- init, shutdown,
-};
diff --git a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/icons/LICENSE b/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/icons/LICENSE
deleted file mode 100644
index e878a43..0000000
--- a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon "icon-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
diff --git a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/icons/icon-32.png b/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/icons/icon-32.png
deleted file mode 100644
index 35c2eba..0000000
Binary files a/embedded-webextension-bootstrapped/step0-legacy-addon/chrome/icons/icon-32.png and /dev/null differ
diff --git a/embedded-webextension-bootstrapped/step0-legacy-addon/install.rdf b/embedded-webextension-bootstrapped/step0-legacy-addon/install.rdf
deleted file mode 100644
index 71feaa4..0000000
--- a/embedded-webextension-bootstrapped/step0-legacy-addon/install.rdf
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
- original-bootstrap-addon-id@mozilla.com
- 2
- true
- false
- 0.1.0
- Legacy Addon Name
-
- A simple bootstrap addon which wants to transition to a WebExtension.
-
- Step 0: original legacy bootstrap addon.
-
- Luca Greco <lgreco@mozilla.com>
-
-
-
- {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
- 49.0
- *
-
-
-
-
-
- {aa3c5121-dab2-40e2-81ca-7ea25febc110}
- 49.0
- *
-
-
-
-
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/bootstrap.js b/embedded-webextension-bootstrapped/step1-hybrid-addon/bootstrap.js
deleted file mode 100644
index 573ba93..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/bootstrap.js
+++ /dev/null
@@ -1,24 +0,0 @@
-"use strict";
-
-function startup({webExtension}) {
- Components.utils.import("chrome://original-bootstrap-addon-id/content/AddonPrefs.jsm");
-
- // Start the embedded webextension.
- webExtension.startup().then(api => {
- const {browser} = api;
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- if (msg == "import-legacy-data") {
- // When the embedded webextension asks for the legacy data,
- // dump the data which needs to be preserved and send it back to the
- // embedded extension.
- sendReply({
- "super-important-user-setting": AddonPrefs.get("super-important-user-setting"),
- });
- }
- });
- });
-}
-
-function shutdown(data) {
- Components.utils.unload("chrome://original-bootstrap-addon-id/content/AddonPrefs.jsm");
-}
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/chrome.manifest b/embedded-webextension-bootstrapped/step1-hybrid-addon/chrome.manifest
deleted file mode 100644
index abbe1db..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content original-bootstrap-addon-id chrome/
\ No newline at end of file
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/chrome/AddonPrefs.jsm b/embedded-webextension-bootstrapped/step1-hybrid-addon/chrome/AddonPrefs.jsm
deleted file mode 100644
index 2d4d3cf..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/chrome/AddonPrefs.jsm
+++ /dev/null
@@ -1,41 +0,0 @@
-"use strict";
-
-var EXPORTED_SYMBOLS = ["AddonPrefs"];
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-const BASE_PREF = "extensions.original-bootstrap-addon-id.";
-
-function get(key, type = "char") {
- key = BASE_PREF + key;
-
- switch(type) {
- case "char":
- return Services.prefs.getCharPref(key);
- case "bool":
- return Services.prefs.getBoolPref(key);
- case "int":
- return Services.prefs.getIntPref(key);
- }
-
- throw new Error(`Unknown type: ${type}`);
-}
-
-function set(key, type, value) {
- key = BASE_PREF + key;
-
- switch(type) {
- case "char":
- return Services.prefs.setCharPref(key, value);
- case "bool":
- return Services.prefs.setBoolPref(key, value);
- case "int":
- return Services.prefs.setIntPref(key, value);
- }
-
- throw new Error(`Unknown type: ${type}`);
-}
-
-var AddonPrefs = {
- get, set,
-};
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/install.rdf b/embedded-webextension-bootstrapped/step1-hybrid-addon/install.rdf
deleted file mode 100644
index c15c9b8..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/install.rdf
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
- original-bootstrap-addon-id@mozilla.com
- 2
- true
- true
- false
- 0.2.0
- Legacy Addon Name
-
- A simple bootstrap addon which wants to transition to a WebExtension.
-
- Step 1: transition hybrid addon.
-
- Luca Greco <lgreco@mozilla.com>
-
-
-
- {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
- 51.0a1
- *
-
-
-
-
-
- {aa3c5121-dab2-40e2-81ca-7ea25febc110}
- 51.0a1
- *
-
-
-
-
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/background.js b/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/background.js
deleted file mode 100644
index b1ba3e9..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/background.js
+++ /dev/null
@@ -1,16 +0,0 @@
-"use strict";
-
-browser.storage.local.get("super-important-user-setting")
- .then(results => {
- // If the old preferences data has not been imported yet...
- if (!results["super-important-user-setting"]) {
- // Ask to the legacy part to dump the needed data and send it back
- // to the background page...
- browser.runtime.sendMessage("import-legacy-data").then(reply => {
- if (reply) {
- // Where it can be saved using the WebExtensions storage API.
- browser.storage.local.set(reply);
- }
- });
- }
- });
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/icons/LICENSE b/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/icons/LICENSE
deleted file mode 100644
index e878a43..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon "icon-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/icons/icon-32.png b/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/icons/icon-32.png
deleted file mode 100644
index 35c2eba..0000000
Binary files a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/icons/icon-32.png and /dev/null differ
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/manifest.json b/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/manifest.json
deleted file mode 100644
index 048c4ec..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/manifest.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "Legacy Addon Name",
- "version": "0.2.0",
- "manifest_version": 2,
- "permissions": ["storage"],
- "background": {
- "scripts": ["background.js"]
- },
- "browser_action": {
- "browser_style": true,
- "default_icon": "icons/icon-32.png",
- "default_title": "button label",
- "default_popup": "popup.html"
- }
-}
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/popup.html b/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/popup.html
deleted file mode 100644
index 284b7b9..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/popup.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/popup.js b/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/popup.js
deleted file mode 100644
index ab5360d..0000000
--- a/embedded-webextension-bootstrapped/step1-hybrid-addon/webextension/popup.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-var gettingItem = browser.storage.local.get("super-important-user-setting");
-gettingItem.then(results => {
- const panelContent = results["super-important-user-setting"] || "No settings saved.";
- document.querySelector("#panel-content").textContent = panelContent;
-});
diff --git a/embedded-webextension-bootstrapped/step2-pure-webextension/icons/LICENSE b/embedded-webextension-bootstrapped/step2-pure-webextension/icons/LICENSE
deleted file mode 100644
index e878a43..0000000
--- a/embedded-webextension-bootstrapped/step2-pure-webextension/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon "icon-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
diff --git a/embedded-webextension-bootstrapped/step2-pure-webextension/icons/icon-32.png b/embedded-webextension-bootstrapped/step2-pure-webextension/icons/icon-32.png
deleted file mode 100644
index 35c2eba..0000000
Binary files a/embedded-webextension-bootstrapped/step2-pure-webextension/icons/icon-32.png and /dev/null differ
diff --git a/embedded-webextension-bootstrapped/step2-pure-webextension/manifest.json b/embedded-webextension-bootstrapped/step2-pure-webextension/manifest.json
deleted file mode 100644
index b80f579..0000000
--- a/embedded-webextension-bootstrapped/step2-pure-webextension/manifest.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "Legacy Addon Name",
- "version": "0.3.0",
- "manifest_version": 2,
- "permissions": ["storage"],
- "browser_action": {
- "browser_style": true,
- "default_icon": "icons/icon-32.png",
- "default_title": "button label",
- "default_popup": "popup.html"
- },
- "applications": {
- "gecko": {
- "id": "original-bootstrap-addon-id@mozilla.com",
- "strict_min_version": "51.0a1"
- }
- }
-}
diff --git a/embedded-webextension-bootstrapped/step2-pure-webextension/popup.html b/embedded-webextension-bootstrapped/step2-pure-webextension/popup.html
deleted file mode 100644
index 284b7b9..0000000
--- a/embedded-webextension-bootstrapped/step2-pure-webextension/popup.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/embedded-webextension-bootstrapped/step2-pure-webextension/popup.js b/embedded-webextension-bootstrapped/step2-pure-webextension/popup.js
deleted file mode 100644
index ab5360d..0000000
--- a/embedded-webextension-bootstrapped/step2-pure-webextension/popup.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-var gettingItem = browser.storage.local.get("super-important-user-setting");
-gettingItem.then(results => {
- const panelContent = results["super-important-user-setting"] || "No settings saved.";
- document.querySelector("#panel-content").textContent = panelContent;
-});
diff --git a/embedded-webextension-sdk/README.md b/embedded-webextension-sdk/README.md
deleted file mode 100644
index b72ab74..0000000
--- a/embedded-webextension-sdk/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-This is an example of how to use [embedded WebExtensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Embedded_WebExtensions) to convert a legacy [SDK add-on](https://developer.mozilla.org/en-US/Add-ons/SDK) to a [WebExtension](https://developer.mozilla.org/en-US/Add-ons/WebExtensions) in stages, and migrate the legacy add-on's data so it's accessible by the WebExtension.
-
-The legacy add-on contains:
-
-- A content script that is attached to any pages under "mozilla.org" or any of its subdomains. The content script sends a message to the main add-on, which then displays a [notification](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/notifications).
-- Some user data stored using the SDK's [`simple-prefs`](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/simple-prefs) API.
-- Some user data stored using the SDK's [`simple-storage`](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/simple-storage) API.
-- A button in the toolbar: when the button is pressed, the add-on shows a panel containing the stored data.
-
-This directory contains three versions of the add-on.
-
-- **step0-legacy-addon**: the initial add-on, written entirely using the Add-on SDK.
-- **step1-hybrid-addon**: a hybrid consisting of an Add-on SDK add-on containing an embedded WebExtension. The Add-on SDK part sends the stored data to the embedded WebExtension. It also listens for any changes to the [`simple-prefs`](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/simple-prefs) data, and updates the WebExtension whenever that data is changed (for example, if the user changes the data in the add-on's preferences UI under about:addons). The embedded WebExtension stores the data using the [`storage`](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage) API and implements everything else, including the button/panel and the content script.
-- **step2-pure-webextension**: the final version, written entirely using the WebExtensions method. This version can be deployed after the hybrid version has migrated the stored data to the `storage` API. In this version the add-on uses an [options page](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Options_pages) to provide a UI for the preferences data.
diff --git a/embedded-webextension-sdk/step0-legacy-addon/data/content-script.js b/embedded-webextension-sdk/step0-legacy-addon/data/content-script.js
deleted file mode 100644
index 8506fb6..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/data/content-script.js
+++ /dev/null
@@ -1 +0,0 @@
-self.port.emit("notify-attached-tab", window.location.href);
diff --git a/embedded-webextension-sdk/step0-legacy-addon/data/icons/LICENSE b/embedded-webextension-sdk/step0-legacy-addon/data/icons/LICENSE
deleted file mode 100644
index e878a43..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/data/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon "icon-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
diff --git a/embedded-webextension-sdk/step0-legacy-addon/data/icons/icon-32.png b/embedded-webextension-sdk/step0-legacy-addon/data/icons/icon-32.png
deleted file mode 100644
index 35c2eba..0000000
Binary files a/embedded-webextension-sdk/step0-legacy-addon/data/icons/icon-32.png and /dev/null differ
diff --git a/embedded-webextension-sdk/step0-legacy-addon/data/popup.html b/embedded-webextension-sdk/step0-legacy-addon/data/popup.html
deleted file mode 100644
index 9f208a9..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/data/popup.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/embedded-webextension-sdk/step0-legacy-addon/data/popup.js b/embedded-webextension-sdk/step0-legacy-addon/data/popup.js
deleted file mode 100644
index fc69eec..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/data/popup.js
+++ /dev/null
@@ -1,3 +0,0 @@
-addon.port.on("got-user-data", results => {
- document.querySelector("#panel-content").textContent = JSON.stringify(results, null, 2);
-});
diff --git a/embedded-webextension-sdk/step0-legacy-addon/lib/addon-ui.js b/embedded-webextension-sdk/step0-legacy-addon/lib/addon-ui.js
deleted file mode 100644
index 022206e..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/lib/addon-ui.js
+++ /dev/null
@@ -1,42 +0,0 @@
-const { ToggleButton } = require('sdk/ui/button/toggle');
-const panels = require("sdk/panel");
-const self = require("sdk/self");
-const ss = require("sdk/simple-storage");
-const sp = require("sdk/simple-prefs");
-
-const button = ToggleButton({
- id: "my-button",
- label: "my button",
- icon: {
- "32": self.data.url("icons/icon-32.png"),
- },
- onChange: handleChange,
-});
-
-const panel = panels.Panel({
- contentURL: self.data.url("popup.html"),
- onHide: handleHide,
-});
-
-panel.on("show", () => {
- panel.port.emit("got-user-data", {
- prefs: {
- superImportantUserPref: sp.prefs["superImportantUserPref"],
- },
- storage: {
- superImportantUserStoredData: ss.storage.superImportantUserStoredData,
- },
- });
-});
-
-function handleChange(state) {
- if (state.checked) {
- panel.show({
- position: button,
- });
- }
-}
-
-function handleHide() {
- button.state('window', {checked: false});
-}
diff --git a/embedded-webextension-sdk/step0-legacy-addon/lib/content-scripts.js b/embedded-webextension-sdk/step0-legacy-addon/lib/content-scripts.js
deleted file mode 100644
index cf4f1fa..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/lib/content-scripts.js
+++ /dev/null
@@ -1,18 +0,0 @@
-const data = require("sdk/self").data;
-const pageMod = require("sdk/page-mod");
-const notifications = require("sdk/notifications");
-
-pageMod.PageMod({
- include: "*.mozilla.org",
- contentScriptFile: [
- data.url("content-script.js"),
- ],
- onAttach: function(worker) {
- worker.port.on("notify-attached-tab", (msg) => {
- notifications.notify({
- title: "Attached to tab",
- text: msg
- });
- });
- }
-});
diff --git a/embedded-webextension-sdk/step0-legacy-addon/lib/user-data-storage.js b/embedded-webextension-sdk/step0-legacy-addon/lib/user-data-storage.js
deleted file mode 100644
index d9abd8d..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/lib/user-data-storage.js
+++ /dev/null
@@ -1,3 +0,0 @@
-const ss = require("sdk/simple-storage");
-
-ss.storage.superImportantUserStoredData = "This value was saved in the simple-storage";
diff --git a/embedded-webextension-sdk/step0-legacy-addon/main.js b/embedded-webextension-sdk/step0-legacy-addon/main.js
deleted file mode 100644
index ced1b02..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/main.js
+++ /dev/null
@@ -1,3 +0,0 @@
-require("./lib/addon-ui");
-require("./lib/user-data-storage");
-require("./lib/content-scripts");
diff --git a/embedded-webextension-sdk/step0-legacy-addon/package.json b/embedded-webextension-sdk/step0-legacy-addon/package.json
deleted file mode 100644
index 92d1c8d..0000000
--- a/embedded-webextension-sdk/step0-legacy-addon/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "id": "original-sdk-addon-id@mozilla.com",
- "version": "0.1.0",
- "main": "./main.js",
- "name": "sdk-addon-name",
- "fullName": "SDK Addon Name",
- "description": "A simple SDK addon which wants to transition to a WebExtension",
- "preferences": [
- {
- "name": "superImportantUserPref",
- "title": "Super important user preference",
- "type": "string",
- "value": "saved superImportantUserPref value"
- }
- ],
- "engines": {
- "firefox": ">= 49",
- "fennec": ">= 49"
- }
-}
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/lib/user-data-storage.js b/embedded-webextension-sdk/step1-hybrid-addon/lib/user-data-storage.js
deleted file mode 100644
index ad616b3..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/lib/user-data-storage.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const sp = require("sdk/simple-prefs");
-const ss = require("sdk/simple-storage");
-
-ss.storage.superImportantUserStoredData = "This value was saved in the simple-storage";
-
-exports.setSyncLegacyDataPort = function(port) {
- // Send the initial data dump.
- port.postMessage({
- prefs: {
- superImportantUserPref: sp.prefs["superImportantUserPref"],
- },
- storage: {
- superImportantUserStoredData: ss.storage.superImportantUserStoredData,
- },
- });
-
- // Keep the preferences in sync with the data stored in the webextension.
- sp.on("superImportantUserPref", () => {
- port.postMessage({
- prefs: {
- superImportantUserPref: sp.prefs["superImportantUserPref"],
- }
- });
- });
-};
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/main.js b/embedded-webextension-sdk/step1-hybrid-addon/main.js
deleted file mode 100644
index 5c02fce..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/main.js
+++ /dev/null
@@ -1,10 +0,0 @@
-const webext = require("sdk/webextension");
-const {setSyncLegacyDataPort} = require("./lib/user-data-storage");
-
-webext.startup().then(({browser}) => {
- browser.runtime.onConnect.addListener(port => {
- if (port.name === "sync-legacy-addon-data") {
- setSyncLegacyDataPort(port);
- }
- });
-});
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/package.json b/embedded-webextension-sdk/step1-hybrid-addon/package.json
deleted file mode 100644
index 62615b0..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "id": "original-sdk-addon-id@mozilla.com",
- "version": "0.2.0",
- "main": "./main.js",
- "name": "sdk-addon-name",
- "fullName": "SDK Addon Name",
- "description": "A simple SDK addon which wants to transition to a WebExtension",
- "preferences": [
- {
- "name": "superImportantUserPref",
- "title": "Super important user preference",
- "type": "string",
- "value": "saved superImportantUserPref value"
- }
- ],
- "engines": {
- "firefox": ">= 51.0a1",
- "fennec": ">= 51.0a1"
- },
- "hasEmbeddedWebExtension": true
-}
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/webextension/background.js b/embedded-webextension-sdk/step1-hybrid-addon/webextension/background.js
deleted file mode 100644
index 9f9a472..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/webextension/background.js
+++ /dev/null
@@ -1,25 +0,0 @@
-"use strict";
-
-// Ask to the legacy part to dump the needed data and send it back
-// to the background page...
-var port = browser.runtime.connect({name: "sync-legacy-addon-data"});
-port.onMessage.addListener((msg) => {
- if (msg) {
- // Where it can be saved using the WebExtensions storage API.
- browser.storage.local.set(msg);
- }
-});
-
-browser.runtime.onMessage.addListener(msg => {
- const {type} = msg;
-
- switch (type) {
- case "notify-attached-tab":
- browser.notifications.create({
- type: "basic",
- title: "Attached to tab",
- message: msg.message
- });
- break;
- }
-});
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/webextension/content-script.js b/embedded-webextension-sdk/step1-hybrid-addon/webextension/content-script.js
deleted file mode 100644
index 80a9dae..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/webextension/content-script.js
+++ /dev/null
@@ -1,4 +0,0 @@
-browser.runtime.sendMessage({
- type: "notify-attached-tab",
- message: window.location.href,
-});
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/webextension/icons/LICENSE b/embedded-webextension-sdk/step1-hybrid-addon/webextension/icons/LICENSE
deleted file mode 100644
index e878a43..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/webextension/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon "icon-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/webextension/icons/icon-32.png b/embedded-webextension-sdk/step1-hybrid-addon/webextension/icons/icon-32.png
deleted file mode 100644
index 35c2eba..0000000
Binary files a/embedded-webextension-sdk/step1-hybrid-addon/webextension/icons/icon-32.png and /dev/null differ
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/webextension/manifest.json b/embedded-webextension-sdk/step1-hybrid-addon/webextension/manifest.json
deleted file mode 100644
index 0c4b37f..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/webextension/manifest.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "SDK Transition Addon",
- "version": "0.2.0",
- "manifest_version": 2,
- "permissions": ["storage", "notifications"],
- "background": {
- "scripts": ["background.js"]
- },
- "content_scripts": [
- {
- "matches": ["*://*.mozilla.org/*"],
- "js": ["content-script.js"]
- }
- ],
- "browser_action": {
- "browser_style": true,
- "default_icon": "icons/icon-32.png",
- "default_title": "button label",
- "default_popup": "popup.html"
- }
-}
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/webextension/popup.html b/embedded-webextension-sdk/step1-hybrid-addon/webextension/popup.html
deleted file mode 100644
index 9f208a9..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/webextension/popup.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/embedded-webextension-sdk/step1-hybrid-addon/webextension/popup.js b/embedded-webextension-sdk/step1-hybrid-addon/webextension/popup.js
deleted file mode 100644
index a58ece8..0000000
--- a/embedded-webextension-sdk/step1-hybrid-addon/webextension/popup.js
+++ /dev/null
@@ -1,4 +0,0 @@
-const gettingItem = browser.storage.local.get();
-gettingItem.then((results) => {
- document.querySelector("#panel-content").textContent = JSON.stringify(results, null, 2);
-});
diff --git a/embedded-webextension-sdk/step2-pure-webextension/background.js b/embedded-webextension-sdk/step2-pure-webextension/background.js
deleted file mode 100644
index bf59a60..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/background.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-browser.runtime.onMessage.addListener(msg => {
- const {type} = msg;
-
- switch (type) {
- case "notify-attached-tab":
- browser.notifications.create({
- type: "basic",
- title: "Attached to tab",
- message: msg.message
- });
- break;
- }
-});
diff --git a/embedded-webextension-sdk/step2-pure-webextension/content-script.js b/embedded-webextension-sdk/step2-pure-webextension/content-script.js
deleted file mode 100644
index 80a9dae..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/content-script.js
+++ /dev/null
@@ -1,4 +0,0 @@
-browser.runtime.sendMessage({
- type: "notify-attached-tab",
- message: window.location.href,
-});
diff --git a/embedded-webextension-sdk/step2-pure-webextension/icons/LICENSE b/embedded-webextension-sdk/step2-pure-webextension/icons/LICENSE
deleted file mode 100644
index e878a43..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon "icon-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
diff --git a/embedded-webextension-sdk/step2-pure-webextension/icons/icon-32.png b/embedded-webextension-sdk/step2-pure-webextension/icons/icon-32.png
deleted file mode 100644
index 35c2eba..0000000
Binary files a/embedded-webextension-sdk/step2-pure-webextension/icons/icon-32.png and /dev/null differ
diff --git a/embedded-webextension-sdk/step2-pure-webextension/manifest.json b/embedded-webextension-sdk/step2-pure-webextension/manifest.json
deleted file mode 100644
index ba06037..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/manifest.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "SDK Addon Name",
- "version": "0.3.0",
- "manifest_version": 2,
- "permissions": ["storage", "notifications"],
- "background": {
- "scripts": ["background.js"]
- },
- "content_scripts": [
- {
- "matches": ["*://*.mozilla.org/*"],
- "js": ["content-script.js"]
- }
- ],
- "options_ui": {
- "page": "options.html"
- },
- "browser_action": {
- "browser_style": true,
- "default_icon": "icons/icon-32.png",
- "default_title": "button label",
- "default_popup": "popup.html"
- },
- "applications": {
- "gecko": {
- "id": "original-sdk-addon-id@mozilla.com",
- "strict_min_version": "51.0a1"
- }
- }
-}
diff --git a/embedded-webextension-sdk/step2-pure-webextension/options.html b/embedded-webextension-sdk/step2-pure-webextension/options.html
deleted file mode 100644
index a2deba8..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/options.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/embedded-webextension-sdk/step2-pure-webextension/options.js b/embedded-webextension-sdk/step2-pure-webextension/options.js
deleted file mode 100644
index 22a840e..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/options.js
+++ /dev/null
@@ -1,21 +0,0 @@
-const gettingItem = browser.storage.local.get("prefs");
-gettingItem.then(results => {
- const {prefs} = results || {
- prefs: {
- superImportantUserPref: "default value"
- },
- };
-
- const el = document.querySelector("#superImportantUserPref");
- el.value = prefs.superImportantUserPref;
-
- const updatePref = () => {
- browser.storage.local.set({
- prefs: {
- superImportantUserPref: el.value,
- },
- });
- };
-
- el.addEventListener("input", updatePref);
-});
diff --git a/embedded-webextension-sdk/step2-pure-webextension/popup.html b/embedded-webextension-sdk/step2-pure-webextension/popup.html
deleted file mode 100644
index 9f208a9..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/popup.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/embedded-webextension-sdk/step2-pure-webextension/popup.js b/embedded-webextension-sdk/step2-pure-webextension/popup.js
deleted file mode 100644
index a58ece8..0000000
--- a/embedded-webextension-sdk/step2-pure-webextension/popup.js
+++ /dev/null
@@ -1,4 +0,0 @@
-const gettingItem = browser.storage.local.get();
-gettingItem.then((results) => {
- document.querySelector("#panel-content").textContent = JSON.stringify(results, null, 2);
-});
diff --git a/emoji-substitution/README.md b/emoji-substitution/README.md
deleted file mode 100644
index e29b7f2..0000000
--- a/emoji-substitution/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Emoji Substitution
-
-**This add-on injects JavaScript into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does
-
-Replaces words that describe an emoji with the emoji itself. This runs as a content script and scans web pages, looking for text that can be replaced with emoji. As an example, after installing visit https://mozilla.org and notice that the text "firefox" should change.
-
-## What it shows
-
-A good example for beginners that can be used as a "make your first add-on" tutorial and / or referenced to create other add-ons.
diff --git a/emoji-substitution/emojiMap.js b/emoji-substitution/emojiMap.js
deleted file mode 100644
index 16c689e..0000000
--- a/emoji-substitution/emojiMap.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file contains the Map of word --> emoji substitutions.
- */
-
-let dictionary = new Map();
-dictionary.set('apple', '🍎');
-dictionary.set('banana', '🍌');
-dictionary.set('bang', '💥');
-dictionary.set('baseball', '⚾');
-dictionary.set('basketball', '🏀');
-dictionary.set('beer', '🍺');
-dictionary.set('bicycle', '🚴');
-dictionary.set('bike', '🚴');
-dictionary.set('bomb', '💣');
-dictionary.set('boy', '👦');
-dictionary.set('bug', '🐛');
-dictionary.set('burger', '🍔');
-dictionary.set('burn', '🔥');
-dictionary.set('cake', '🎂');
-dictionary.set('candy', '🍬');
-dictionary.set('cat', '🐱');
-dictionary.set('celebration', '🎉');
-dictionary.set('cheeseburger', '🍔');
-dictionary.set('cookie', '🍪');
-dictionary.set('cool', '😎');
-dictionary.set('cry', '😢');
-dictionary.set('dog', '🐶');
-dictionary.set('doge', '🐕');
-dictionary.set('earth', '🌎');
-dictionary.set('explode', '💥');
-dictionary.set('fart', '💨');
-dictionary.set('fast', '💨');
-dictionary.set('female', '👩');
-dictionary.set('fire', '🔥');
-dictionary.set('fish', '🐟');
-dictionary.set('flame', '🔥');
-dictionary.set('flower', '🌹');
-dictionary.set('food', '🍕');
-dictionary.set('football', '🏈');
-dictionary.set('girl', '👧');
-dictionary.set('golf', '⛳');
-dictionary.set('hamburger', '🍔');
-dictionary.set('happy', '😀');
-dictionary.set('horse', '🐴');
-dictionary.set('hot', '🔥');
-dictionary.set('kiss', '😘');
-dictionary.set('laugh', '😂');
-dictionary.set('lit', '🔥');
-dictionary.set('lock', '🔒');
-dictionary.set('lol', '😂');
-dictionary.set('love', '😍');
-dictionary.set('male', '👨');
-dictionary.set('man', '👨');
-dictionary.set('monkey', '🐵');
-dictionary.set('moon', '🌙');
-dictionary.set('note', '📝');
-dictionary.set('paint', '🎨');
-dictionary.set('panda', '🐼');
-dictionary.set('party', '🎉');
-dictionary.set('pig', '🐷');
-dictionary.set('pizza', '🍕');
-dictionary.set('planet', '🌎');
-dictionary.set('rose', '🌹');
-dictionary.set('rofl', '😂');
-dictionary.set('sad', '😢');
-dictionary.set('sleep', '😴');
-dictionary.set('smile', '😀');
-dictionary.set('smiley', '😀');
-dictionary.set('soccer', '⚽');
-dictionary.set('star', '⭐');
-dictionary.set('sun', '☀️');
-dictionary.set('sunglasses', '😎');
-dictionary.set('surprised', '😮');
-dictionary.set('tree', '🌲');
-dictionary.set('trophy', '🏆');
-dictionary.set('win', '🏆');
-dictionary.set('wind', '💨');
-dictionary.set('wine', '🍷');
-dictionary.set('wink', '😉');
-dictionary.set('woman', '👩');
-dictionary.set('world', '🌎');
-dictionary.set('wow', '😮');
-
-/*
- * After all the dictionary entries have been set, sort them by length.
- *
- * Because iteration over Maps happens by insertion order, this avoids
- * scenarios where words that are substrings of other words get substituted
- * first, leading to the longer word's substitution never triggering.
- *
- * For example, the 'woman' substitution would never get triggered
- * if the 'man' substitution happens first because the input term 'woman'
- * would become 'wo👨', and the search for 'woman' would not find any matches.
- */
-let tempArray = Array.from(dictionary);
-tempArray.sort((pair1, pair2) => {
- // Each pair is an array with two entries: a word, and its emoji.
- // Ex: ['woman', '👩']
- const firstWord = pair1[0];
- const secondWord = pair2[0];
-
- if (firstWord.length > secondWord.length) {
- // The first word should come before the second word.
- return -1;
- }
- if (secondWord.length > firstWord.length) {
- // The second word should come before the first word.
- return 1;
- }
-
- // The words have the same length, it doesn't matter which comes first.
- return 0;
-});
-
-// Now that the entries are sorted, put them back into a Map.
-let sortedEmojiMap = new Map(tempArray);
diff --git a/emoji-substitution/icons/icon.png b/emoji-substitution/icons/icon.png
deleted file mode 100644
index b35102a..0000000
Binary files a/emoji-substitution/icons/icon.png and /dev/null differ
diff --git a/emoji-substitution/icons/icon@2x.png b/emoji-substitution/icons/icon@2x.png
deleted file mode 100644
index a5acdb1..0000000
Binary files a/emoji-substitution/icons/icon@2x.png and /dev/null differ
diff --git a/emoji-substitution/manifest.json b/emoji-substitution/manifest.json
deleted file mode 100644
index e6f1067..0000000
--- a/emoji-substitution/manifest.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "manifest_version": 2,
- "name": "Emoji Substitution",
- "description": "Replaces words with emojis.",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/emoji-substitution",
- "version": "1.0",
- "icons": {
- "48": "icons/icon.png",
- "96": "icons/icon@2x.png"
- },
-
- "content_scripts": [
- {
- "matches": [""],
- "js": ["./emojiMap.js", "./substitute.js"]
- }
- ]
-}
diff --git a/emoji-substitution/substitute.js b/emoji-substitution/substitute.js
deleted file mode 100644
index c886063..0000000
--- a/emoji-substitution/substitute.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * This file is responsible for performing the logic of replacing
- * all occurrences of each mapped word with its emoji counterpart.
- */
-
-// emojiMap.js defines the 'sortedEmojiMap' variable.
-// Referenced here to reduce confusion.
-const emojiMap = sortedEmojiMap;
-
-/*
- * For efficiency, create a word --> search RegEx Map too.
- */
-let regexs = new Map();
-for (let word of emojiMap.keys()) {
- // We want a global, case-insensitive replacement.
- // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
- regexs.set(word, new RegExp(word, 'gi'));
-}
-
-/**
- * Substitutes emojis into text nodes.
- * If the node contains more than just text (ex: it has child nodes),
- * call replaceText() on each of its children.
- *
- * @param {Node} node - The target DOM Node.
- * @return {void} - Note: the emoji substitution is done inline.
- */
-function replaceText (node) {
- // Setting textContent on a node removes all of its children and replaces
- // them with a single text node. Since we don't want to alter the DOM aside
- // from substituting text, we only substitute on single text nodes.
- // @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent
- if (node.nodeType === Node.TEXT_NODE) {
- // This node only contains text.
- // @see https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType.
-
- // Skip textarea nodes due to the potential for accidental submission
- // of substituted emoji where none was intended.
- if (node.parentNode &&
- node.parentNode.nodeName === 'TEXTAREA') {
- return;
- }
-
- // Because DOM manipulation is slow, we don't want to keep setting
- // textContent after every replacement. Instead, manipulate a copy of
- // this string outside of the DOM and then perform the manipulation
- // once, at the end.
- let content = node.textContent;
-
- // Replace every occurrence of 'word' in 'content' with its emoji.
- // Use the emojiMap for replacements.
- for (let [word, emoji] of emojiMap) {
- // Grab the search regex for this word.
- const regex = regexs.get(word);
-
- // Actually do the replacement / substitution.
- // Note: if 'word' does not appear in 'content', nothing happens.
- content = content.replace(regex, emoji);
- }
-
- // Now that all the replacements are done, perform the DOM manipulation.
- node.textContent = content;
- }
- else {
- // This node contains more than just text, call replaceText() on each
- // of its children.
- for (let i = 0; i < node.childNodes.length; i++) {
- replaceText(node.childNodes[i]);
- }
- }
-}
-
-// Start the recursion from the body tag.
-replaceText(document.body);
-
-// Now monitor the DOM for additions and substitute emoji into new nodes.
-// @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver.
-const observer = new MutationObserver((mutations) => {
- mutations.forEach((mutation) => {
- if (mutation.addedNodes && mutation.addedNodes.length > 0) {
- // This DOM change was new nodes being added. Run our substitution
- // algorithm on each newly added node.
- for (let i = 0; i < mutation.addedNodes.length; i++) {
- const newNode = mutation.addedNodes[i];
- replaceText(newNode);
- }
- }
- });
-});
-observer.observe(document.body, {
- childList: true,
- subtree: true
-});
diff --git a/eslint-example/.eslintrc.json b/eslint-example/.eslintrc.json
deleted file mode 100644
index 51d8a7f..0000000
--- a/eslint-example/.eslintrc.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "globals": {
- "browser": true,
- "chrome": true
- },
- "rules": {
- "no-set-state": "off"
- },
- "env": {
- "browser": true,
- "es6": true
- },
- "extends": [
- "eslint:recommended"
- ]
-}
\ No newline at end of file
diff --git a/eslint-example/.gitignore b/eslint-example/.gitignore
deleted file mode 100644
index c2658d7..0000000
--- a/eslint-example/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/
diff --git a/eslint-example/README.md b/eslint-example/README.md
deleted file mode 100644
index ca380ba..0000000
--- a/eslint-example/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ESLint Example
-
-## What it shows
-
-This shows how to configure a WebExtension with
-[eslint](http://eslint.org/)
-to protect against
-writing JavaScript code that may be incompatible with modern versions of
-Firefox or Chrome.
-
-## How to use it
-
-This requires [NodeJS](https://nodejs.org/en/) and [npm](http://npmjs.com/).
-
-* Change into the example directory and run `npm install` to install all
- dependencies.
-* Execute `npm run lint` to view a report of any coding errors.
diff --git a/eslint-example/file.js b/eslint-example/file.js
deleted file mode 100644
index 62f4e6d..0000000
--- a/eslint-example/file.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// This special eslint comment will declare that the named
-// function has been "exported" into the global scope.
-
-/* exported getUsefulContents */
-function getUsefulContents(callback) {
- callback('Hello World');
-}
diff --git a/eslint-example/icons/LICENSE b/eslint-example/icons/LICENSE
deleted file mode 100644
index 20e821d..0000000
--- a/eslint-example/icons/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-
-The "page-32.png" and "page-48.png" icons are taken from the miu iconset created by Linh Pham Thi Dieu, and are used under the terms of its license: http://linhpham.me/miu/.
diff --git a/eslint-example/icons/page-32.png b/eslint-example/icons/page-32.png
deleted file mode 100644
index dae663d..0000000
Binary files a/eslint-example/icons/page-32.png and /dev/null differ
diff --git a/eslint-example/icons/page-48.png b/eslint-example/icons/page-48.png
deleted file mode 100644
index ba042cd..0000000
Binary files a/eslint-example/icons/page-48.png and /dev/null differ
diff --git a/eslint-example/main.js b/eslint-example/main.js
deleted file mode 100644
index 5f5981e..0000000
--- a/eslint-example/main.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// This special eslint comment declares that the code below relies on
-// a named function in the global scope.
-
-/* global getUsefulContents */
-function start() {
- getUsefulContents(data => {
- var display = document.getElementById('display');
-
- display.innerHTML = data;
- });
-}
-
-document.addEventListener('DOMContentLoaded', start);
diff --git a/eslint-example/manifest.json b/eslint-example/manifest.json
deleted file mode 100644
index 21dfebf..0000000
--- a/eslint-example/manifest.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "manifest_version": 2,
- "description": "Example using eslint",
- "name": "eslint-example",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/eslint-example",
-
- "browser_action": {
- "default_icon": "icons/page-32.png",
- "default_popup": "popup.html"
- }
-}
\ No newline at end of file
diff --git a/eslint-example/package.json b/eslint-example/package.json
deleted file mode 100644
index 314d61e..0000000
--- a/eslint-example/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "eslint-example",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {
- "eslint": "^3.9.0"
- },
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "lint": "eslint ."
- },
- "author": "",
- "license": "ISC"
-}
\ No newline at end of file
diff --git a/eslint-example/popup.html b/eslint-example/popup.html
deleted file mode 100644
index 92abfaa..0000000
--- a/eslint-example/popup.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- Pop-up
-
-
-
Example.com
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples.json b/examples.json
deleted file mode 100644
index 8f4be45..0000000
--- a/examples.json
+++ /dev/null
@@ -1,263 +0,0 @@
-[
- {
- "javascript_apis": [
- "pageAction.getTitle",
- "pageAction.onClicked",
- "pageAction.setIcon",
- "pageAction.setTitle",
- "pageAction.show",
- "tabs.insertCSS",
- "tabs.onUpdated",
- "tabs.query",
- "tabs.removeCSS"
- ],
- "name": "apply-css",
- "description": "Adds a page action to the toolbar. Click the button to apply a red border using injected CSS. Click the button again to remove the CSS."
- },
- {
- "javascript_apis": [
- "extension.getURL",
- "runtime.onMessage",
- "tabs.executeScript",
- "tabs.query",
- "tabs.reload",
- "tabs.sendMessage"
- ],
- "name": "beastify",
- "description": "Adds a browser action icon to the toolbar. Click the button to choose a beast. The active tab's body content is then replaced with a picture of the chosen beast."
- },
- {
- "javascript_apis": [
- "bookmarks.create",
- "bookmarks.remove",
- "bookmarks.search",
- "browserAction.onClicked",
- "browserAction.setIcon",
- "tabs.onActivated",
- "tabs.onUpdated",
- "tabs.query"
- ],
- "name": "bookmark-it",
- "description": "Adds a bookmark button to the toolbar. Click the button to toggle a bookmark for the current page."
- },
- {
- "javascript_apis": [],
- "name": "borderify",
- "description": "Adds a solid red border to all webpages matching mozilla.org."
- },
- {
- "javascript_apis": [
- "alarms.clearAll",
- "alarms.create",
- "alarms.onAlarm",
- "pageAction.hide",
- "pageAction.onClicked",
- "pageAction.show",
- "tabs.get",
- "tabs.onActivated",
- "tabs.onUpdated",
- "tabs.query",
- "tabs.update"
- ],
- "name": "chill-out",
- "description": "Show a page action after a period of inactivity. Show cat gifs when the page action is clicked."
- },
- {
- "javascript_apis": [
- "commands.getAll",
- "commands.onCommand"
- ],
- "name": "commands",
- "description": "Demonstrates using the commands API to set up a keyboard shortcut. Thr shortcut created is accessed using Ctrl+Shift+Y (Command+Shift+Y on a Mac)."
- },
- {
- "javascript_apis": [
- "contextMenus.create",
- "contextMenus.onClicked",
- "contextMenus.remove",
- "contextMenus.update",
- "i18n.getMessage",
- "runtime.lastError",
- "tabs.executeScript"
- ],
- "name": "context-menu-demo",
- "description": "Demonstrates adding and manipulating context menu items using the contextMenus API."
- },
- {
- "javascript_apis": [
- "cookies.get",
- "cookies.onChanged",
- "cookies.remove",
- "cookies.set",
- "extension.getURL",
- "runtime.onMessage",
- "tabs.executeScript",
- "tabs.onUpdated",
- "tabs.query",
- "tabs.sendMessage"
- ],
- "name": "cookie-bg-picker",
- "description": "Allows the user to customize the background color and tiled pattern on sites the visit, and also saves their preferences via a cookie, reapplying them whenever they revisit a site they previously customized."
- },
- {
- "javascript_apis": [
- "runtime.onMessage",
- "runtime.sendMessage",
- "storage.local"
- ],
- "name": "embedded-webextension-bootstrapped",
- "description": "Demonstrates how to use an embedded WebExtension to port from a bootstrapped extension."
- },
- {
- "javascript_apis": [
- "notifications.create",
- "runtime.connect",
- "runtime.onConnect",
- "runtime.onMessage",
- "runtime.sendMessage",
- "storage.local"
- ],
- "name": "embedded-webextension-sdk",
- "description": "Demonstrates how to use an embedded WebExtension to port from an SDK-based add-on."
- },
- {
- "javascript_apis": [],
- "name": "emoji-substitution",
- "description": "Replaces words with emojis."
- },
- {
- "javascript_apis": [
- "browserAction.onClicked",
- "runtime.openOptionsPage",
- "storage.local"
- ],
- "name": "favourite-colour",
- "description": "An example options page, letting you store your favourite colour."
- },
- {
- "javascript_apis": [
- "history.deleteUrl",
- "history.search",
- "pageAction.show",
- "tabs.onUpdated",
- "tabs.query"
- ],
- "name": "history-deleter",
- "description": "History API demo: deletes history items for a given domain"
- },
- {
- "javascript_apis": [
- "downloads.erase",
- "downloads.getFileIcon",
- "downloads.open",
- "downloads.removeFile",
- "downloads.search"
- ],
- "name": "latest-download",
- "description": "Shows the last downloaded item, and lets you open or delete it."
- },
- {
- "javascript_apis": [
- "cookies.getAll",
- "tabs.query"
- ],
- "name": "list-cookies",
- "description": ""
- },
- {
- "javascript_apis": [
- "browserAction.onClicked",
- "runtime.connectNative"
- ],
- "name": "native-messaging",
- "description": "Example of native messaging, including a Python application and a WebExtension which exchanges messages with it."
- },
- {
- "javascript_apis": [
- "storage.local",
- "webNavigation.onCompleted"
- ],
- "name": "navigation-stats",
- "description": "Demonstration of the webNavigation API, showing basic stata about which pages you've visited."
- },
- {
- "javascript_apis": [
- "extension.getURL",
- "i18n.getMessage",
- "notifications.create",
- "runtime.onMessage",
- "runtime.sendMessage"
- ],
- "name": "notify-link-clicks-i18n",
- "description": "Shows a localized notification when the user clicks on links."
- },
- {
- "javascript_apis": [
- "browserAction.onClicked",
- "tabs.create"
- ],
- "name": "open-my-page-button",
- "description": "Adds a browser action icon to the toolbar. When the browser action is clicked, the add-on opens a page that was packaged with it."
- },
- {
- "javascript_apis": [],
- "name": "page-to-extension-messaging",
- "description": "Demonstrates how a web page and a content script can exchange messages. Visit https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html for the demo."
- },
- {
- "javascript_apis": [
- "storage.local"
- ],
- "name": "quicknote",
- "description": "Allows the user to make quick notes by clicking a button and entering text into the resulting popup. The notes are saved in storage."
- },
- {
- "javascript_apis": [],
- "name": "selection-to-clipboard",
- "description": "Demonstrates how to write to the clipboard from a content script"
- },
- {
- "javascript_apis": [
- "tabs.create",
- "tabs.duplicate",
- "tabs.getZoom",
- "tabs.highlight",
- "tabs.move",
- "tabs.onMoved",
- "tabs.onRemoved",
- "tabs.query",
- "tabs.reload",
- "tabs.remove",
- "tabs.setZoom"
- ],
- "name": "tabs-tabs-tabs",
- "description": "Demonstrates tab manipulation: opening, closing, moving, zooming tabs."
- },
- {
- "javascript_apis": [
- "extension.getBackgroundPage",
- "webRequest.onBeforeSendHeaders"
- ],
- "name": "user-agent-rewriter",
- "description": "Demonstrates using the webRequest API to rewrite the User-Agent HTTP header."
- },
- {
- "javascript_apis": [
- "runtime.onMessage",
- "runtime.sendMessage"
- ],
- "name": "webpack-modules",
- "description": "Demonstrates how to use webpack to package npm modules in a WebExtension."
- },
- {
- "javascript_apis": [
- "windows.create",
- "windows.getAll",
- "windows.getCurrent",
- "windows.remove",
- "windows.update"
- ],
- "name": "window-manipulator",
- "description": "Demonstrates how to manipulate windows: opening, closing, resizing windows."
- }
-]
diff --git a/favourite-colour/README.md b/favourite-colour/README.md
deleted file mode 100644
index 4cbfa5b..0000000
--- a/favourite-colour/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Favourite Colour
-
-Shows and stores your favourite colour, in storage.local
-in the about:addons page for the add-on.
-
-Demonstrates: storing data with storage.local, runtime.openOptionsPage and
-creating an options page.
diff --git a/favourite-colour/background.js b/favourite-colour/background.js
deleted file mode 100644
index be08803..0000000
--- a/favourite-colour/background.js
+++ /dev/null
@@ -1,5 +0,0 @@
-function handleClick() {
- browser.runtime.openOptionsPage();
-}
-
-browser.browserAction.onClicked.addListener(handleClick);
diff --git a/favourite-colour/manifest.json b/favourite-colour/manifest.json
deleted file mode 100644
index e6bc69b..0000000
--- a/favourite-colour/manifest.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "background": {
- "scripts": ["background.js"]
- },
- "browser_action": {
- "default_title": "Favourite colour option"
- },
- "description": "An example options ui",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/favourite-colour",
- "manifest_version": 2,
- "name": "Favourite colour",
- "options_ui": {
- "page": "options.html"
- },
- "permissions": ["storage"],
- "version": "1.0"
-}
diff --git a/favourite-colour/options.html b/favourite-colour/options.html
deleted file mode 100644
index ed9a7bf..0000000
--- a/favourite-colour/options.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/favourite-colour/options.js b/favourite-colour/options.js
deleted file mode 100644
index b9cd3de..0000000
--- a/favourite-colour/options.js
+++ /dev/null
@@ -1,16 +0,0 @@
-function saveOptions(e) {
- browser.storage.local.set({
- colour: document.querySelector("#colour").value
- });
- e.preventDefault();
-}
-
-function restoreOptions() {
- var gettingItem = browser.storage.local.get('colour');
- gettingItem.then((res) => {
- document.querySelector("#colour").value = res.colour || 'Firefox red';
- });
-}
-
-document.addEventListener('DOMContentLoaded', restoreOptions);
-document.querySelector("form").addEventListener("submit", saveOptions);
diff --git a/firefox-code-search/README.md b/firefox-code-search/README.md
deleted file mode 100644
index 19e9681..0000000
--- a/firefox-code-search/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# firefox-code-search
-
-## What it does
-
-This extension allows you to search the Firefox codebase using the awesome bar.
-
-To test it out, type 'cs' into the awesome bar followed by a search string (e.g. `cs hello world`). The results will be shown as suggestions, and clicking on a suggestion will navigate to the file where the result was found.
-
-To search a specific file, use the "path:" prefix (e.g. `cs hello path:omnibox.js`)
-
-## What it shows
-
-How to use the omnibox API to add custom suggestions to the awesome bar.
\ No newline at end of file
diff --git a/firefox-code-search/background.js b/firefox-code-search/background.js
deleted file mode 100644
index a467a47..0000000
--- a/firefox-code-search/background.js
+++ /dev/null
@@ -1,101 +0,0 @@
-const BASE_URL = "https://searchfox.org/mozilla-central";
-const SEARCH_URL = `${BASE_URL}/search`;
-const SOURCE_URL = `${BASE_URL}/source`;
-
-// Provide help text to the user.
-browser.omnibox.setDefaultSuggestion({
- description: `Search the firefox codebase
- (e.g. "hello world" | "path:omnibox.js onInputChanged")`
-});
-
-// Update the suggestions whenever the input is changed.
-browser.omnibox.onInputChanged.addListener((text, addSuggestions) => {
- let headers = new Headers({"Accept": "application/json"});
- let init = {method: 'GET', headers};
- let url = buildSearchURL(text);
- let request = new Request(url, init);
-
- fetch(request)
- .then(createSuggestionsFromResponse)
- .then(addSuggestions);
-});
-
-// Open the page based on how the user clicks on a suggestion.
-browser.omnibox.onInputEntered.addListener((text, disposition) => {
- let url = text;
- if (!text.startsWith(SOURCE_URL)) {
- // Update the url if the user clicks on the default suggestion.
- url = `${SEARCH_URL}?q=${text}`;
- }
- switch (disposition) {
- case "currentTab":
- browser.tabs.update({url});
- break;
- case "newForegroundTab":
- browser.tabs.create({url});
- break;
- case "newBackgroundTab":
- browser.tabs.create({url, active: false});
- break;
- }
-});
-
-function buildSearchURL(text) {
- let path = '';
- let queryParts = [];
- let query = '';
- let parts = text.split(' ');
-
- parts.forEach(part => {
- if (part.startsWith("path:")) {
- path = part.slice(5);
- } else {
- queryParts.push(part);
- }
- });
-
- query = queryParts.join(' ');
- return `${SEARCH_URL}?q=${query}&path=${path}`;
-}
-
-function createSuggestionsFromResponse(response) {
- return new Promise(resolve => {
- let suggestions = [];
- let suggestionsOnEmptyResults = [{
- content: SOURCE_URL,
- description: "no results found"
- }];
- response.json().then(json => {
- if (!json.normal) {
- return resolve(suggestionsOnEmptyResults);
- }
-
- let occurrences = json.normal["Textual Occurrences"];
- let files = json.normal["Files"];
-
- if (!occurrences && !files) {
- return resolve(suggestionsOnEmptyResults);
- }
-
- if (occurrences) {
- occurrences.forEach(({path, lines}) => {
- suggestions.push({
- content: `${SOURCE_URL}/${path}#${lines[0].lno}`,
- description: lines[0].line,
- });
- });
- return resolve(suggestions);
- }
-
- // There won't be any textual occurrences if the "path:" prefix is used.
- files.forEach(({path}) => {
- suggestions.push({
- content: `${SOURCE_URL}/${path}`,
- description: path,
- });
- });
- return resolve(suggestions);
- });
- });
-}
-
diff --git a/firefox-code-search/manifest.json b/firefox-code-search/manifest.json
deleted file mode 100644
index 38c6bad..0000000
--- a/firefox-code-search/manifest.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "Firefox Code Search",
- "description" : "To use, type 'cs' plus a search term into the url bar.",
- "version": "1.0",
- "applications": {
- "gecko": {
- "strict_min_version": "52.0a1"
- }
- },
- "background": {
- "scripts": ["background.js"]
- },
- "omnibox": { "keyword" : "cs" },
- "manifest_version": 2,
- "permissions": [
- "https://searchfox.org/"
- ]
-}
diff --git a/history-deleter/README.md b/history-deleter/README.md
deleted file mode 100644
index 4c2d3b0..0000000
--- a/history-deleter/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# History deleter
-
-## What it does
-
-This extension includes a page action with a popup specified as "history.html". The page action will not appear on about:... pages.
-
-The popup shows a list of 5 history entries for the current domain. It provides a clear button to delete all entries for that domain.
-
-## What it shows
-
-How to use the history API.
diff --git a/history-deleter/background.js b/history-deleter/background.js
deleted file mode 100644
index dd9f375..0000000
--- a/history-deleter/background.js
+++ /dev/null
@@ -1,5 +0,0 @@
-browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
- if (!tab.url.match(/^about:/)) {
- browser.pageAction.show(tab.id);
- }
-});
diff --git a/history-deleter/history.css b/history-deleter/history.css
deleted file mode 100644
index 3f413da..0000000
--- a/history-deleter/history.css
+++ /dev/null
@@ -1,32 +0,0 @@
-html, body {
- margin: 0.3em;
- width: auto;
- min-width: 250px;
- max-width: 500px;
- background-color: #f8f8f8;
-}
-
-div {
- margin-left: 0.5em;
- margin-right: 0.5em;
- border-bottom: 1px solid grey;
-}
-
-#history-title {
- font-weight: bold;
- margin-left: 0.5em;
- margin-right: 0.5em;
-}
-
-#history {
- display: block;
- word-wrap: break-word;
- margin: 0.5em;
- text-decoration: none;
-}
-
-#clear {
- text-decoration: none;
- margin-left: 0.5em;
- margin-right: 0.5em;
-}
\ No newline at end of file
diff --git a/history-deleter/history.html b/history-deleter/history.html
deleted file mode 100644
index 30ac9cb..0000000
--- a/history-deleter/history.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/history-deleter/history.js b/history-deleter/history.js
deleted file mode 100644
index 11a1dff..0000000
--- a/history-deleter/history.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// A useful way to extract the domain from a url.
-function get_hostname(url) {
- var a = document.createElement('a');
- a.href = url;
- set_domain(a.hostname);
- return a.hostname;
-}
-
-function set_domain(domain) {
- spans = document.getElementsByClassName('domain');
- [].slice.call(spans).forEach((span) => {
- span.textContent = domain;
- });
-}
-
-function no_history(hostname) {
- var history_text = document.getElementById('history');
- while(history_text.firstChild)
- history_text.removeChild(history_text.firstChild);
- history_text.textContent = `No history for ${hostname}.`;
-}
-
-function getActiveTab() {
- return browser.tabs.query({active: true, currentWindow: true});
-}
-
-// When the page is loaded find the current tab and then use that to query
-// the history.
-getActiveTab().then((tabs) => {
- var list = document.getElementById('history');
- var hostname = get_hostname(tabs[0].url);
-
- // Search for all history entries for the current windows domain.
- // Because this could be a lot of entries, lets limit it to 5.
- var searchingHistory = browser.history.search({text: hostname, maxResults: 5});
- searchingHistory.then((results) => {
- // What to show if there are no results.
- if (results.length < 1) {
- no_history(hostname);
- } else {
- for (var k in results) {
- var history = results[k];
- var li = document.createElement('p');
- var a = document.createElement('a');
- var url = document.createTextNode(history.url);
- a.href = history.url;
- a.target = '_blank';
- a.appendChild(url);
- li.appendChild(a);
- list.appendChild(li);
- }
- }
- });
-});
-
-function clearAll(e) {
- getActiveTab().then((tabs) => {
- var hostname = get_hostname(tabs[0].url);
- if (!hostname) {
- // Don't try and delete history when there's no hostname.
- return;
- }
-
- // Search will return us a list of histories for this domain.
- // Loop through them and delete them one by one.
- var searchingHistory = browser.history.search({text: hostname})
- searchingHistory.then((results) => {
- for (k = 0; k < results.length; k++) {
- browser.history.deleteUrl({url: results[k].url});
- }
- // Clear out the UI.
- no_history(hostname);
- }
- );
- });
- e.preventDefault();
-}
-
-document.getElementById('clear').addEventListener('click', clearAll);
diff --git a/history-deleter/manifest.json b/history-deleter/manifest.json
deleted file mode 100644
index de0d8b9..0000000
--- a/history-deleter/manifest.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "background": {
- "scripts": ["background.js"]
- },
- "description": "Gives a popup to list and delete history on a domain.",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/history-deleter",
- "page_action": {
- "default_title": "History deleter",
- "default_popup": "history.html"
- },
- "permissions": [
- "activeTab",
- "history",
- "tabs"
- ],
- "manifest_version": 2,
- "name": "History Deleter",
- "version": "1.0"
-}
diff --git a/latest-download/README.md b/latest-download/README.md
deleted file mode 100644
index b1475ec..0000000
--- a/latest-download/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# latest-download
-
-## What it does ##
-
-The extension includes a browser action with a popup.
-
-When the user clicks the browser action button, the popup is shown.
-The popup displays the most recent download, and has buttons to open the
-file or to remove it.
-
-If the user removes it, the file is removed from disk and from the browser's
-downloads history.
-
-## What it shows ##
-
-* how to use various parts of the downloads API
diff --git a/latest-download/icons/LICENSE b/latest-download/icons/LICENSE
deleted file mode 100644
index 20e821d..0000000
--- a/latest-download/icons/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-
-The "page-32.png" and "page-48.png" icons are taken from the miu iconset created by Linh Pham Thi Dieu, and are used under the terms of its license: http://linhpham.me/miu/.
diff --git a/latest-download/icons/page-32.png b/latest-download/icons/page-32.png
deleted file mode 100644
index dae663d..0000000
Binary files a/latest-download/icons/page-32.png and /dev/null differ
diff --git a/latest-download/icons/page-48.png b/latest-download/icons/page-48.png
deleted file mode 100644
index ba042cd..0000000
Binary files a/latest-download/icons/page-48.png and /dev/null differ
diff --git a/latest-download/manifest.json b/latest-download/manifest.json
deleted file mode 100644
index e240f2e..0000000
--- a/latest-download/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-
- "description": "Shows the last downloaded item, and lets you open or delete it",
- "manifest_version": 2,
- "name": "latest-download",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/latest-download",
- "icons": {
- "48": "icons/page-48.png"
- },
-
- "permissions": [
- "downloads",
- "downloads.open"
- ],
-
- "browser_action": {
- "browser_style": true,
- "default_icon": "icons/page-32.png",
- "default_title": "Latest download",
- "default_popup": "popup/latest_download.html"
- }
-
-}
diff --git a/latest-download/popup/latest_download.html b/latest-download/popup/latest_download.html
deleted file mode 100644
index fd8c794..0000000
--- a/latest-download/popup/latest_download.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/latest-download/popup/latest_download.js b/latest-download/popup/latest_download.js
deleted file mode 100644
index 5619131..0000000
--- a/latest-download/popup/latest_download.js
+++ /dev/null
@@ -1,70 +0,0 @@
-
-var latestDownloadId;
-
-/*
-Callback from getFileIcon.
-Initialize the displayed icon.
-*/
-function updateIconUrl(iconUrl) {
- var downloadIcon = document.querySelector("#icon");
- downloadIcon.setAttribute("src", iconUrl);
-}
-
-function onError(error) {
- console.log(`Error: ${error}`);
-}
-
-/*
-If there was a download item,
-- remember its ID as latestDownloadId
-- initialize the displayed icon using getFileIcon
-- initialize the displayed URL
-If there wasn't a download item, disable the "open" and "remove" buttons.
-*/
-function initializeLatestDownload(downloadItems) {
- var downloadUrl = document.querySelector("#url");
- if (downloadItems.length > 0) {
- latestDownloadId = downloadItems[0].id;
- var gettingIconUrl = browser.downloads.getFileIcon(latestDownloadId);
- gettingIconUrl.then(updateIconUrl, onError);
- downloadUrl.textContent = downloadItems[0].url;
- document.querySelector("#open").classList.remove("disabled");
- document.querySelector("#remove").classList.remove("disabled");
- } else {
- downloadUrl.textContent = "No downloaded items found."
- document.querySelector("#open").classList.add("disabled");
- document.querySelector("#remove").classList.add("disabled");
- }
-}
-
-/*
-Search for the most recent download, and pass it to initializeLatestDownload()
-*/
-var searching = browser.downloads.search({
- limit: 1,
- orderBy: ["-startTime"]
-});
-searching.then(initializeLatestDownload);
-
-/*
-Open the item using the associated application.
-*/
-function openItem() {
- if (!document.querySelector("#open").classList.contains("disabled")) {
- browser.downloads.open(latestDownloadId);
- }
-}
-
-/*
-Remove item from disk (removeFile) and from the download history (erase)
-*/
-function removeItem() {
- if (!document.querySelector("#remove").classList.contains("disabled")) {
- browser.downloads.removeFile(latestDownloadId);
- browser.downloads.erase({id: latestDownloadId});
- window.close();
- }
-}
-
-document.querySelector("#open").addEventListener("click", openItem);
-document.querySelector("#remove").addEventListener("click", removeItem);
diff --git a/list-cookies/README.md b/list-cookies/README.md
deleted file mode 100644
index 877c00e..0000000
--- a/list-cookies/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# list-cookies
-
-## What it does
-
-This extensions list the cookies in the active tab.
-
-# What it shows
-
-Demonstration of the getAll() function in the cookie API
diff --git a/list-cookies/cookies.css b/list-cookies/cookies.css
deleted file mode 100644
index 95af25c..0000000
--- a/list-cookies/cookies.css
+++ /dev/null
@@ -1,11 +0,0 @@
-html, body {
- width: 500px;
-}
-
-.panel {
- padding: 5px;
-}
-
-li {
- margin-bottom: 5px;
-}
diff --git a/list-cookies/cookies.html b/list-cookies/cookies.html
deleted file mode 100644
index a15ad76..0000000
--- a/list-cookies/cookies.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/list-cookies/cookies.js b/list-cookies/cookies.js
deleted file mode 100644
index 74c5a84..0000000
--- a/list-cookies/cookies.js
+++ /dev/null
@@ -1,39 +0,0 @@
-function showCookiesForTab(tabs) {
- //get the first tab object in the array
- tab = tabs.pop();
-
- //get all cookies in the domain
- var gettingAllCookies = browser.cookies.getAll({url: tab.url});
- gettingAllCookies.then((cookies) => {
-
- //set the header of the panel
- var activeTabUrl = document.getElementById('header-title');
- var text = document.createTextNode("Cookies at: "+tab.title);
- var cookieList = document.getElementById('cookie-list');
- activeTabUrl.appendChild(text);
-
- if (cookies.length > 0) {
- //add an
item with the name and value of the cookie to the list
- for (cookie of cookies) {
- var li = document.createElement("li");
- var content = document.createTextNode(cookie.name + ": "+ cookie.value);
- li.appendChild(content);
- cookieList.appendChild(li);
- }
- } else {
- var p = document.createElement("p");
- var content = document.createTextNode("No cookies in this tab.");
- var parent = cookieList.parentNode;
-
- p.appendChild(content);
- parent.appendChild(p);
- }
- });
-};
-
-//get active tab to run an callback function.
-//it sends to our callback an array of tab objects
-function getActiveTab() {
- return browser.tabs.query({currentWindow: true, active: true});
-}
-getActiveTab().then(showCookiesForTab);
diff --git a/list-cookies/icons/cookie.png b/list-cookies/icons/cookie.png
deleted file mode 100644
index 5567982..0000000
Binary files a/list-cookies/icons/cookie.png and /dev/null differ
diff --git a/list-cookies/icons/cookie@2x.png b/list-cookies/icons/cookie@2x.png
deleted file mode 100644
index d3de8e9..0000000
Binary files a/list-cookies/icons/cookie@2x.png and /dev/null differ
diff --git a/list-cookies/icons/default19.png b/list-cookies/icons/default19.png
deleted file mode 100644
index aa4d283..0000000
Binary files a/list-cookies/icons/default19.png and /dev/null differ
diff --git a/list-cookies/icons/default38.png b/list-cookies/icons/default38.png
deleted file mode 100644
index 335fe0a..0000000
Binary files a/list-cookies/icons/default38.png and /dev/null differ
diff --git a/list-cookies/manifest.json b/list-cookies/manifest.json
deleted file mode 100644
index 9dbec54..0000000
--- a/list-cookies/manifest.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "browser_action": {
- "browser_style": true,
- "default_title": "List cookies in the active tab",
- "default_popup": "cookies.html",
- "default_icon": {
- "19": "icons/default19.png",
- "38": "icons/default38.png"
- }
- },
- "description": "List cookies in the active tab.",
- "icons": {
- "48": "icons/cookie.png",
- "96": "icons/cookie@2x.png"
- },
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/list-cookies",
- "manifest_version": 2,
- "name": "List cookies",
- "version": "1.0",
- "permissions": ["cookies","","tabs"]
-}
diff --git a/mocha-client-tests/.gitignore b/mocha-client-tests/.gitignore
deleted file mode 100644
index f53b1be..0000000
--- a/mocha-client-tests/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-node_modules
-addon/bower_components
-addon/node_modules
-.idea
\ No newline at end of file
diff --git a/mocha-client-tests/README.md b/mocha-client-tests/README.md
deleted file mode 100644
index ee72c2a..0000000
--- a/mocha-client-tests/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-#Mocha client tests for WebExtensions
-##Introduction
-This example shows two methods of testing a WebExtension:
-* Running tests from within the addon
-* Running tests from the commandline using Karma
-
-See https://github.com/Standard8/example-webextension for a more complete example of WebExtension test configuration.
-
-##Install Dependencies:
-```
- npm install
-```
-To run tests from within the addon:
-```
- cd addon
- npm install
-```
-
-##Testing within the Addon
-This gives you the possibility to run client tests inside the addon with the mocha UI.
-If you don't want to use the mocha UI, you can install [WebConsole-reporter](https://github.com/eeroan/WebConsole-reporter).
-
-###Run with web-ext cli
-Just run `npm run web-ext` (will work with FF dev edition), if you have error with web-ext cli please add path for FF binary file with `--firefox-binary /path/to/firefox-bin`
-[(web-ext docs)](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/web-ext_command_reference).
-
-When the addon starts, click on the mocha icon in your browser bar to run the tests:
-
-
-
-This will test `./addon/background.js` with `./addon/tests/lib/background-messaging.test.js`.
-
-##Testing from the Commandline
-This uses [Karma](http://karma-runner.github.io) to run tests from the commandline. Just type `npm test` to test `./addon/background.js` with `./tests/lib/background.test.js`.
-
-###Debug Mode
-Use `npm run test:debug` to run Karma in watch mode. Whenever you modify a Javascript file, the tests will automatically rerun.
-
-You can install [karma-notification-reporter](https://www.npmjs.com/package/karma-notification-reporter) to display test results in a desktop notification. You'll need to add `--reporters=dots,notification` to the `test:debug` command line of
-`package.json` to enable it.
diff --git a/mocha-client-tests/addon/background.js b/mocha-client-tests/addon/background.js
deleted file mode 100644
index c434fcc..0000000
--- a/mocha-client-tests/addon/background.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var Background = {
- receiveMessage: function(msg, sender, sendResponse) {
- if (msg && msg.action && Background.hasOwnProperty(msg.action)) {
- return Background[msg.action](msg, sender, sendResponse);
- } else {
- console.warn('No handler for message: ' + JSON.stringify(msg));
- }
- },
- ping: function(msg, sender, sendResponse) {
- sendResponse('pong');
- return true;
- }
-};
-
-chrome.runtime.onMessage.addListener(Background.receiveMessage);
diff --git a/mocha-client-tests/addon/images/icon-16.png b/mocha-client-tests/addon/images/icon-16.png
deleted file mode 100644
index 01da9f4..0000000
Binary files a/mocha-client-tests/addon/images/icon-16.png and /dev/null differ
diff --git a/mocha-client-tests/addon/images/icon-19.png b/mocha-client-tests/addon/images/icon-19.png
deleted file mode 100644
index 1c80c9d..0000000
Binary files a/mocha-client-tests/addon/images/icon-19.png and /dev/null differ
diff --git a/mocha-client-tests/addon/images/mocha.png b/mocha-client-tests/addon/images/mocha.png
deleted file mode 100644
index 83f1196..0000000
Binary files a/mocha-client-tests/addon/images/mocha.png and /dev/null differ
diff --git a/mocha-client-tests/addon/manifest.json b/mocha-client-tests/addon/manifest.json
deleted file mode 100644
index 26b0f43..0000000
--- a/mocha-client-tests/addon/manifest.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "Mocha tests",
- "version": "1.0",
- "manifest_version": 2,
- "description": "Check ",
- "icons": {
- "16": "images/icon-16.png"
- },
- "short_name": "MochaTest",
- "background": {
- "scripts": [
- "background.js"
- ]
- },
- "browser_action": {
- "default_icon": {
- "19": "images/icon-19.png"
- },
- "default_title": "Mocha Test",
- "default_popup": "popup.html"
- },
- "applications": {
- "gecko": {
- "strict_min_version": "45.0"
- }
- },
- "content_security_policy": "script-src 'self'; object-src 'self'; img-src 'self'"
-}
diff --git a/mocha-client-tests/addon/package.json b/mocha-client-tests/addon/package.json
deleted file mode 100644
index 31faea1..0000000
--- a/mocha-client-tests/addon/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "mocha-tests-webextension",
- "version": "1.0.0",
- "description": "Run test inside your addon",
- "main": "background.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "",
- "license": "MPL-2.0",
- "devDependencies": {
- "expect.js": "^0.3.1",
- "mocha": "^3.1.2"
- }
-}
diff --git a/mocha-client-tests/addon/popup.html b/mocha-client-tests/addon/popup.html
deleted file mode 100644
index 9c33a6f..0000000
--- a/mocha-client-tests/addon/popup.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- Mocha Tests
-
-
-
-
-
-
-
-
-
Hello! Lets play at ping
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mocha-client-tests/addon/scripts/browser-polyfill.min.js b/mocha-client-tests/addon/scripts/browser-polyfill.min.js
deleted file mode 100644
index 8c87af7..0000000
--- a/mocha-client-tests/addon/scripts/browser-polyfill.min.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-if(typeof browser==="undefined"){const wrapAPIs=()=>{const apiMetadata={"alarms":{"clear":{"minArgs":0,"maxArgs":1},"clearAll":{"minArgs":0,"maxArgs":0},"get":{"minArgs":0,"maxArgs":1},"getAll":{"minArgs":0,"maxArgs":0}},"bookmarks":{"create":{"minArgs":1,"maxArgs":1},"export":{"minArgs":0,"maxArgs":0},"get":{"minArgs":1,"maxArgs":1},"getChildren":{"minArgs":1,"maxArgs":1},"getRecent":{"minArgs":1,"maxArgs":1},"getTree":{"minArgs":0,"maxArgs":0},"getSubTree":{"minArgs":1,"maxArgs":1},"import":{"minArgs":0,
-"maxArgs":0},"move":{"minArgs":2,"maxArgs":2},"remove":{"minArgs":1,"maxArgs":1},"removeTree":{"minArgs":1,"maxArgs":1},"search":{"minArgs":1,"maxArgs":1},"update":{"minArgs":2,"maxArgs":2}},"browserAction":{"getBadgeBackgroundColor":{"minArgs":1,"maxArgs":1},"getBadgeText":{"minArgs":1,"maxArgs":1},"getPopup":{"minArgs":1,"maxArgs":1},"getTitle":{"minArgs":1,"maxArgs":1},"setIcon":{"minArgs":1,"maxArgs":1}},"commands":{"getAll":{"minArgs":0,"maxArgs":0}},"contextMenus":{"update":{"minArgs":2,"maxArgs":2},
-"remove":{"minArgs":1,"maxArgs":1},"removeAll":{"minArgs":0,"maxArgs":0}},"cookies":{"get":{"minArgs":1,"maxArgs":1},"getAll":{"minArgs":1,"maxArgs":1},"getAllCookieStores":{"minArgs":0,"maxArgs":0},"remove":{"minArgs":1,"maxArgs":1},"set":{"minArgs":1,"maxArgs":1}},"downloads":{"download":{"minArgs":1,"maxArgs":1},"cancel":{"minArgs":1,"maxArgs":1},"erase":{"minArgs":1,"maxArgs":1},"getFileIcon":{"minArgs":1,"maxArgs":2},"open":{"minArgs":1,"maxArgs":1},"pause":{"minArgs":1,"maxArgs":1},"removeFile":{"minArgs":1,
-"maxArgs":1},"resume":{"minArgs":1,"maxArgs":1},"search":{"minArgs":1,"maxArgs":1},"show":{"minArgs":1,"maxArgs":1}},"extension":{"isAllowedFileSchemeAccess":{"minArgs":0,"maxArgs":0},"isAllowedIncognitoAccess":{"minArgs":0,"maxArgs":0}},"history":{"addUrl":{"minArgs":1,"maxArgs":1},"getVisits":{"minArgs":1,"maxArgs":1},"deleteAll":{"minArgs":0,"maxArgs":0},"deleteRange":{"minArgs":1,"maxArgs":1},"deleteUrl":{"minArgs":1,"maxArgs":1},"search":{"minArgs":1,"maxArgs":1}},"i18n":{"detectLanguage":{"minArgs":1,
-"maxArgs":1},"getAcceptLanguages":{"minArgs":0,"maxArgs":0}},"idle":{"queryState":{"minArgs":1,"maxArgs":1}},"management":{"get":{"minArgs":1,"maxArgs":1},"getAll":{"minArgs":0,"maxArgs":0},"getSelf":{"minArgs":0,"maxArgs":0},"uninstallSelf":{"minArgs":0,"maxArgs":1}},"notifications":{"clear":{"minArgs":1,"maxArgs":1},"create":{"minArgs":1,"maxArgs":2},"getAll":{"minArgs":0,"maxArgs":0},"getPermissionLevel":{"minArgs":0,"maxArgs":0},"update":{"minArgs":2,"maxArgs":2}},"pageAction":{"getPopup":{"minArgs":1,
-"maxArgs":1},"getTitle":{"minArgs":1,"maxArgs":1},"hide":{"minArgs":0,"maxArgs":0},"setIcon":{"minArgs":1,"maxArgs":1},"show":{"minArgs":0,"maxArgs":0}},"runtime":{"getBackgroundPage":{"minArgs":0,"maxArgs":0},"getBrowserInfo":{"minArgs":0,"maxArgs":0},"getPlatformInfo":{"minArgs":0,"maxArgs":0},"openOptionsPage":{"minArgs":0,"maxArgs":0},"requestUpdateCheck":{"minArgs":0,"maxArgs":0},"sendMessage":{"minArgs":1,"maxArgs":3},"sendNativeMessage":{"minArgs":2,"maxArgs":2},"setUninstallURL":{"minArgs":1,
-"maxArgs":1}},"storage":{"local":{"clear":{"minArgs":0,"maxArgs":0},"get":{"minArgs":0,"maxArgs":1},"getBytesInUse":{"minArgs":0,"maxArgs":1},"remove":{"minArgs":1,"maxArgs":1},"set":{"minArgs":1,"maxArgs":1}},"managed":{"get":{"minArgs":0,"maxArgs":1},"getBytesInUse":{"minArgs":0,"maxArgs":1}},"sync":{"clear":{"minArgs":0,"maxArgs":0},"get":{"minArgs":0,"maxArgs":1},"getBytesInUse":{"minArgs":0,"maxArgs":1},"remove":{"minArgs":1,"maxArgs":1},"set":{"minArgs":1,"maxArgs":1}}},"tabs":{"create":{"minArgs":1,
-"maxArgs":1},"captureVisibleTab":{"minArgs":0,"maxArgs":2},"detectLanguage":{"minArgs":0,"maxArgs":1},"duplicate":{"minArgs":1,"maxArgs":1},"executeScript":{"minArgs":1,"maxArgs":2},"get":{"minArgs":1,"maxArgs":1},"getCurrent":{"minArgs":0,"maxArgs":0},"getZoom":{"minArgs":0,"maxArgs":1},"getZoomSettings":{"minArgs":0,"maxArgs":1},"highlight":{"minArgs":1,"maxArgs":1},"insertCSS":{"minArgs":1,"maxArgs":2},"move":{"minArgs":2,"maxArgs":2},"reload":{"minArgs":0,"maxArgs":2},"remove":{"minArgs":1,"maxArgs":1},
-"query":{"minArgs":1,"maxArgs":1},"removeCSS":{"minArgs":1,"maxArgs":2},"sendMessage":{"minArgs":2,"maxArgs":3},"setZoom":{"minArgs":1,"maxArgs":2},"setZoomSettings":{"minArgs":1,"maxArgs":2},"update":{"minArgs":1,"maxArgs":2}},"webNavigation":{"getAllFrames":{"minArgs":1,"maxArgs":1},"getFrame":{"minArgs":1,"maxArgs":1}},"webRequest":{"handlerBehaviorChanged":{"minArgs":0,"maxArgs":0}},"windows":{"create":{"minArgs":0,"maxArgs":1},"get":{"minArgs":1,"maxArgs":2},"getAll":{"minArgs":0,"maxArgs":1},
-"getCurrent":{"minArgs":0,"maxArgs":1},"getLastFocused":{"minArgs":0,"maxArgs":1},"remove":{"minArgs":1,"maxArgs":1},"update":{"minArgs":2,"maxArgs":2}}};class DefaultWeakMap extends WeakMap{constructor(createItem,items=undefined){super(items);this.createItem=createItem}get(key){if(!this.has(key))this.set(key,this.createItem(key));return super.get(key)}}const isThenable=(value)=>{return value&&typeof value==="object"&&typeof value.then==="function"};const makeCallback=(promise)=>{return(...callbackArgs)=>
-{if(chrome.runtime.lastError)promise.reject(chrome.runtime.lastError);else if(callbackArgs.length===1)promise.resolve(callbackArgs[0]);else promise.resolve(callbackArgs)}};const wrapAsyncFunction=(name,metadata)=>{return function asyncFunctionWrapper(target,...args){if(args.lengthmetadata.maxArgs)throw new Error(`Expected at most ${metadata.maxArgs} arguments for ${name}(), got ${args.length}`);
-return new Promise((resolve,reject)=>{target[name](...args,makeCallback({resolve,reject}))})}};const wrapMethod=(target,method,wrapper)=>{return new Proxy(method,{apply(targetMethod,thisObj,args){return wrapper.call(thisObj,target,...args)}})};let hasOwnProperty=Function.call.bind(Object.prototype.hasOwnProperty);const wrapObject=(target,wrappers={},metadata={})=>{let cache=Object.create(null);let handlers={has(target,prop){return prop in target||prop in cache},get(target,prop,receiver){if(prop in
-cache)return cache[prop];if(!(prop in target))return undefined;let value=target[prop];if(typeof value==="function")if(typeof wrappers[prop]==="function")value=wrapMethod(target,target[prop],wrappers[prop]);else if(hasOwnProperty(metadata,prop)){let wrapper=wrapAsyncFunction(prop,metadata[prop]);value=wrapMethod(target,target[prop],wrapper)}else value=value.bind(target);else if(typeof value==="object"&&value!==null&&(hasOwnProperty(wrappers,prop)||hasOwnProperty(metadata,prop)))value=wrapObject(value,
-wrappers[prop],metadata[prop]);else{Object.defineProperty(cache,prop,{configurable:true,enumerable:true,get(){return target[prop]},set(value){target[prop]=value}});return value}cache[prop]=value;return value},set(target,prop,value,receiver){if(prop in cache)cache[prop]=value;else target[prop]=value;return true},defineProperty(target,prop,desc){return Reflect.defineProperty(cache,prop,desc)},deleteProperty(target,prop){return Reflect.deleteProperty(cache,prop)}};return new Proxy(target,handlers)};
-const wrapEvent=(wrapperMap)=>{addListener(target,listener,...args){target.addListener(wrapperMap.get(listener),...args)},hasListener(target,listener){return target.hasListener(wrapperMap.get(listener))},removeListener(target,listener){target.removeListener(wrapperMap.get(listener))}};const onMessageWrappers=new DefaultWeakMap((listener)=>{if(typeof listener!=="function")return listener;return function onMessage(message,sender,sendResponse){let result=listener(message,sender);if(isThenable(result)){result.then(sendResponse,
-(error)=>{console.error(error);sendResponse(error)});return true}else if(result!==undefined)sendResponse(result)}});const staticWrappers={runtime:{onMessage:wrapEvent(onMessageWrappers)}};return wrapObject(chrome,staticWrappers,apiMetadata)};this.browser=wrapAPIs()};
diff --git a/mocha-client-tests/addon/scripts/popup.js b/mocha-client-tests/addon/scripts/popup.js
deleted file mode 100644
index b352b5f..0000000
--- a/mocha-client-tests/addon/scripts/popup.js
+++ /dev/null
@@ -1,10 +0,0 @@
- setInterval(function() {
- var $game = document.querySelector('#game');
- if($game.innerText !== 'ping'){
- $game.innerText = 'ping';
- } else{
- chrome.runtime.sendMessage({action: 'ping'},function(response) {
- $game.innerText = response;
- });
- }
- }, 1000);
diff --git a/mocha-client-tests/addon/tests/lib/background-messaging.test.js b/mocha-client-tests/addon/tests/lib/background-messaging.test.js
deleted file mode 100644
index b91eb5a..0000000
--- a/mocha-client-tests/addon/tests/lib/background-messaging.test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-describe('Background', function() {
- describe('ping', function() {
- it('should return pong in response', function() {
- // Return a promise for Mocha using the Firefox browser API instead of chrome.
- return browser.runtime.sendMessage({action: 'ping'})
- .then(function(response) {
- expect(response).to.equal('pong');
- });
- });
- });
-});
\ No newline at end of file
diff --git a/mocha-client-tests/addon/tests/lib/test.array.js b/mocha-client-tests/addon/tests/lib/test.array.js
deleted file mode 100644
index 40a5f5e..0000000
--- a/mocha-client-tests/addon/tests/lib/test.array.js
+++ /dev/null
@@ -1,8 +0,0 @@
-describe('Array', function() {
- describe('#indexOf()', function() {
- it('should return -1 when the value is not present', function() {
- expect([1,2,3]).to.not.contain(5);
- expect([1,2,3]).to.not.contain(0);
- });
- });
-});
\ No newline at end of file
diff --git a/mocha-client-tests/addon/tests/mocha-run.js b/mocha-client-tests/addon/tests/mocha-run.js
deleted file mode 100644
index ec1be52..0000000
--- a/mocha-client-tests/addon/tests/mocha-run.js
+++ /dev/null
@@ -1,5 +0,0 @@
-mocha.checkLeaks();
-// Here we add initial global variables to prevent this error:
-// Error: global leaks detected: AppView, ExtensionOptions, ExtensionView, WebView
-mocha.globals(['AppView', 'ExtensionOptions', 'ExtensionView', 'WebView']);
-mocha.run();
\ No newline at end of file
diff --git a/mocha-client-tests/addon/tests/mocha-setup.js b/mocha-client-tests/addon/tests/mocha-setup.js
deleted file mode 100644
index 58a9e9e..0000000
--- a/mocha-client-tests/addon/tests/mocha-setup.js
+++ /dev/null
@@ -1 +0,0 @@
-mocha.setup('bdd');
\ No newline at end of file
diff --git a/mocha-client-tests/karma.conf.js b/mocha-client-tests/karma.conf.js
deleted file mode 100644
index 9544b1d..0000000
--- a/mocha-client-tests/karma.conf.js
+++ /dev/null
@@ -1,73 +0,0 @@
-module.exports = function(config) {
- config.set({
-
- // base path that will be used to resolve all patterns (eg. files, exclude)
- basePath: '',
-
- // frameworks to use
- // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
- frameworks: ['mocha'],
-
- // list of files / patterns to load in the browser
- files: [
- // Test dependencies
- 'node_modules/expect.js/index.js',
- 'node_modules/sinon-chrome/bundle/sinon-chrome-webextensions.min.js',
-
- // Source
- 'addon/*.js',
-
- // Tests
- 'tests/lib/*.js'
- ],
-
- // The tests below are intended to be run from inside the WebExtension itself,
- // not from the Karma test suite.
- exclude: [
- 'addon/tests',
- ],
-
- client: {
- mocha: {
- // change Karma's debug.html to the mocha web reporter
- reporter: 'html',
- },
- },
-
- // preprocess matching files before serving them to the browser
- // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
- preprocessors: {
- },
-
- // test results reporter to use
- // possible values: 'dots', 'progress'
- // available reporters: https://npmjs.org/browse/keyword/karma-reporter
- reporters: ['dots'],
-
- // web server port
- port: 9876,
-
- // enable / disable colors in the output (reporters and logs)
- colors: true,
-
- // level of logging
- // possible values: config.LOG_DISABLE || config.LOG_ERROR ||
- // config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
- logLevel: config.LOG_INFO,
-
- // enable/disable watching file and executing tests when any file changes
- autoWatch: false,
-
- // start these browsers
- // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
- browsers: ['Firefox'],
-
- // Continuous Integration mode
- // if true, Karma captures browsers, runs the tests and exits
- singleRun: true,
-
- // Concurrency level
- // how many browser should be started simultaneous
- concurrency: Infinity,
- });
-};
diff --git a/mocha-client-tests/package.json b/mocha-client-tests/package.json
deleted file mode 100644
index 27976d1..0000000
--- a/mocha-client-tests/package.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "name": "mocha-test-webextension",
- "version": "1.0.0",
- "description": "Example how to run unit tests for WebExtension",
- "main": "index.js",
- "scripts": {
- "test": "karma start",
- "test:debug": "karma start --no-single-run --auto-watch",
- "web-ext": "web-ext run -s ./addon"
- },
- "author": "",
- "license": "MPL-2.0",
- "devDependencies": {
- "chai": "^3.5.0",
- "expect.js": "^0.3.1",
- "karma": "^1.3.0",
- "karma-firefox-launcher": "^1.0.0",
- "karma-mocha": "^1.3.0",
- "mocha": "^3.1.2",
- "sinon-chrome": "^2.1.2",
- "web-ext": "^1.6.0"
- }
-}
diff --git a/mocha-client-tests/screenshots/addon-button.png b/mocha-client-tests/screenshots/addon-button.png
deleted file mode 100644
index 6172e83..0000000
Binary files a/mocha-client-tests/screenshots/addon-button.png and /dev/null differ
diff --git a/mocha-client-tests/tests/lib/background.test.js b/mocha-client-tests/tests/lib/background.test.js
deleted file mode 100644
index 0588bb3..0000000
--- a/mocha-client-tests/tests/lib/background.test.js
+++ /dev/null
@@ -1,10 +0,0 @@
-describe('Background', function() {
- describe('ping', function() {
- it('should return pong in response', function(done) {
- Background.ping(false, false, function(response) {
- expect(response).to.equal('pong');
- done();
- });
- });
- });
-});
diff --git a/native-messaging/README.md b/native-messaging/README.md
deleted file mode 100644
index b2c5999..0000000
--- a/native-messaging/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-This is a very simple example of how to use [native messaging](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging) to exchange messages between a WebExtension and a native application.
-
-The WebExtension, which can be found under "add-on", connects to the native application and listens to messages from it. It then sends a message to the native application when the user clicks on the WebExtension's browser action. The message payload is just "ping".
-
-The native application, which can be found under "app", listens for messages from the WebExtension. When it receives a message, the native application sends a response message whose payload is just "pong". The native application is written in Python.
-
-## Setup ##
-
-To get this working, there's a little setup to do.
-
-### Mac OS/Linux setup ###
-
-1. Check that the [file permissions](https://en.wikipedia.org/wiki/File_system_permissions) for "ping_pong.py" include the `execute` permission.
-2. Edit the "path" property of "ping_pong.json" to point to the location of "ping_pong.py" on your computer.
-3. copy "ping_pong.json" to the correct location on your computer. See [App manifest location ](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging#App_manifest_location) to find the correct location for your OS.
-
-### Windows setup ###
-
-1. Check you have Python installed, and that your system's PATH environment variable includes the path to Python. See [Using Python on Windows](https://docs.python.org/2/using/windows.html). You'll need to restart the web browser after making this change, or the browser won't pick up the new environment variable.
-2. Edit the "path" property of "ping_pong.json" to point to the location of "ping_pong_win.bat" on your computer. Note that you'll need to escape the Windows directory separator, like this: `"path": "C:\\Users\\MDN\\native-messaging\\app\\ping_pong_win.bat"`.
-3. Edit "ping_pong_win.bat" to refer to the location of "ping_pong.py" on your computer.
-4. Add a registry key containing the path to "ping_pong.json" on your computer. See [App manifest location ](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging#App_manifest_location) to find details of the registry key to add.
-
-## Testing the example ##
-
-Then just install the add-on as usual, by visiting about:debugging, clicking "Load Temporary Add-on", and selecting the add-on's "manifest.json".
-
-You should see a new browser action icon in the toolbar. Open the console ("Tools/Web Developer/Browser Console" in Firefox), and click the browser action icon. You should see output like this in the console:
-
- Sending: ping
- Received: pong
-
-If you don't see this output, see the [Troubleshooting guide](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging#Troubleshooting) for ideas.
diff --git a/native-messaging/add-on/background.js b/native-messaging/add-on/background.js
deleted file mode 100644
index 4cdabef..0000000
--- a/native-messaging/add-on/background.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-On startup, connect to the "ping_pong" app.
-*/
-var port = browser.runtime.connectNative("ping_pong");
-
-/*
-Listen for messages from the app.
-*/
-port.onMessage.addListener((response) => {
- console.log("Received: " + response);
-});
-
-/*
-On a click on the browser action, send the app a message.
-*/
-browser.browserAction.onClicked.addListener(() => {
- console.log("Sending: ping");
- port.postMessage("ping");
-});
diff --git a/native-messaging/add-on/icons/LICENSE b/native-messaging/add-on/icons/LICENSE
deleted file mode 100644
index c4e7bdc..0000000
--- a/native-messaging/add-on/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon used here is taken from the "Miscellany Web icons" set by Maria & Guillem (https://www.iconfinder.com/andromina), and is used under the Creative Commons (Attribution 3.0 Unported) license.
diff --git a/native-messaging/add-on/icons/message.svg b/native-messaging/add-on/icons/message.svg
deleted file mode 100644
index 7ee68e2..0000000
--- a/native-messaging/add-on/icons/message.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
\ No newline at end of file
diff --git a/native-messaging/add-on/manifest.json b/native-messaging/add-on/manifest.json
deleted file mode 100644
index bd3ba1f..0000000
--- a/native-messaging/add-on/manifest.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-
- "description": "Native messaging example add-on",
- "manifest_version": 2,
- "name": "Native messaging example",
- "version": "1.0",
- "icons": {
- "48": "icons/message.svg"
- },
-
- "applications": {
- "gecko": {
- "id": "ping_pong@example.org",
- "strict_min_version": "50.0"
- }
- },
-
- "background": {
- "scripts": ["background.js"]
- },
-
- "browser_action": {
- "default_icon": "icons/message.svg"
- },
-
- "permissions": ["nativeMessaging"]
-
-}
diff --git a/native-messaging/app/ping_pong.json b/native-messaging/app/ping_pong.json
deleted file mode 100644
index a257b18..0000000
--- a/native-messaging/app/ping_pong.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "ping_pong",
- "description": "Example host for native messaging",
- "path": "/path/to/native-messaging/app/ping_pong.py",
- "type": "stdio",
- "allowed_extensions": [ "ping_pong@example.org" ]
-}
diff --git a/native-messaging/app/ping_pong.py b/native-messaging/app/ping_pong.py
deleted file mode 100755
index 00d8697..0000000
--- a/native-messaging/app/ping_pong.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-import json
-import struct
-import sys
-
-
-# Read a message from stdin and decode it.
-def getMessage():
- rawLength = sys.stdin.read(4)
- if len(rawLength) == 0:
- sys.exit(0)
- messageLength = struct.unpack('@I', rawLength)[0]
- message = sys.stdin.read(messageLength)
- return json.loads(message)
-
-
-# Encode a message for transmission,
-# given its content.
-def encodeMessage(messageContent):
- encodedContent = json.dumps(messageContent)
- encodedLength = struct.pack('@I', len(encodedContent))
- return {'length': encodedLength, 'content': encodedContent}
-
-
-# Send an encoded message to stdout
-def sendMessage(encodedMessage):
- sys.stdout.write(encodedMessage['length'])
- sys.stdout.write(encodedMessage['content'])
- sys.stdout.flush()
-
-while True:
- receivedMessage = getMessage()
- if receivedMessage == 'ping':
- sendMessage(encodeMessage('pong'))
diff --git a/native-messaging/app/ping_pong_win.bat b/native-messaging/app/ping_pong_win.bat
deleted file mode 100644
index aac2019..0000000
--- a/native-messaging/app/ping_pong_win.bat
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-
-call python C:\path\to\ping_pong.py
diff --git a/navigation-stats/README.md b/navigation-stats/README.md
deleted file mode 100644
index d30d5aa..0000000
--- a/navigation-stats/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# navigation-stats
-
-## What it does ##
-
-The extension includes:
-
-* a background which collects navigation stats using the webNavigation API,
- and store the stats using the storage API.
-* a browser action with a popup including HTML, CSS, and JS, which renders
- the stats stored by the background page
-
-
-When the user navigate on a website from any of the browser tabs, the background
-page collected every completed navigation with the "http" or "https" schemes
-(using an UrlFilter for the listener of the webNavigation events)
-
-When the user clicks the browser action button, the popup is shown, and
-the stats saved using the storage API are retrived and rendered in the
-popup window.
-
-## What it shows ##
-
-* use the webNavigation API to monitor browsing navigation events
-* use an UrlFilter to only receive the webNavigation event using
- one of the supported criteria.
-* use the storage API to persist data over browser reboots and to share it
- between different extension pages.
diff --git a/navigation-stats/background.js b/navigation-stats/background.js
deleted file mode 100644
index 0dee190..0000000
--- a/navigation-stats/background.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Load existent stats with the storage API.
-var gettingStoredStats = browser.storage.local.get("hostNavigationStats");
-gettingStoredStats.then(results => {
- // Initialize the saved stats if not yet initialized.
- if (!results.hostNavigationStats) {
- results = {
- hostNavigationStats: {}
- };
- }
-
- const {hostNavigationStats} = results;
-
- // Monitor completed navigation events and update
- // stats accordingly.
- browser.webNavigation.onCompleted.addListener(evt => {
- // Filter out any sub-frame related navigation event
- if (evt.frameId !== 0) {
- return;
- }
-
- const url = new URL(evt.url);
-
- hostNavigationStats[url.hostname] = hostNavigationStats[url.hostname] || 0;
- hostNavigationStats[url.hostname]++;
-
- // Persist the updated stats.
- browser.storage.local.set(results);
- }, {
- url: [{schemes: ["http", "https"]}]});
-});
diff --git a/navigation-stats/icons/LICENSE b/navigation-stats/icons/LICENSE
deleted file mode 100644
index e878a43..0000000
--- a/navigation-stats/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The icon "icon-32.png" is taken from the IconBeast Lite iconset, and used under the terms of its license (http://www.iconbeast.com/faq/), with a link back to the website: http://www.iconbeast.com/free/.
diff --git a/navigation-stats/icons/icon-32.png b/navigation-stats/icons/icon-32.png
deleted file mode 100644
index b77538f..0000000
Binary files a/navigation-stats/icons/icon-32.png and /dev/null differ
diff --git a/navigation-stats/manifest.json b/navigation-stats/manifest.json
deleted file mode 100644
index fac27f5..0000000
--- a/navigation-stats/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "manifest_version": 2,
- "name": "Navigation Stats",
- "version": "0.1.0",
- "browser_action": {
- "default_icon": {
- "32": "icons/icon-32.png"
- },
- "default_title": "Navigation Stats",
- "default_popup": "popup.html"
- },
- "permissions": ["webNavigation", "storage"],
- "background": {
- "scripts": [ "background.js" ]
- },
- "icons": {
- "32": "icons/icon-32.png"
- },
- "applications": {
- "gecko": {
- "strict_min_version": "50.0"
- }
- }
-}
diff --git a/navigation-stats/popup.html b/navigation-stats/popup.html
deleted file mode 100644
index 2788d4c..0000000
--- a/navigation-stats/popup.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
Top navigated hosts:
-
-
No data collected yet...
-
-
-
-
diff --git a/navigation-stats/popup.js b/navigation-stats/popup.js
deleted file mode 100644
index 9d39c42..0000000
--- a/navigation-stats/popup.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Get the saved stats and render the data in the popup window.
-var gettingStoredStats = browser.storage.local.get("hostNavigationStats");
-gettingStoredStats.then(results => {
- if (!results.hostNavigationStats) {
- return;
- }
-
- const {hostNavigationStats} = results;
- const sortedHostnames = Object.keys(hostNavigationStats).sort((a, b) => {
- return hostNavigationStats[a] <= hostNavigationStats[b];
- });
-
- if (sortedHostnames.length === 0) {
- return;
- }
-
- let listEl = document.querySelector("ul");
- while(listEl.firstChild)
- listEl.removeChild(listEl.firstChild);
-
- const MAX_ITEMS = 5;
- for (let i=0; i < sortedHostnames.length; i++) {
- if (i >= MAX_ITEMS) {
- break;
- }
-
- const listItem = document.createElement("li");
- const hostname = sortedHostnames[i];
- listItem.textContent = `${hostname}: ${hostNavigationStats[hostname]} visit(s)`;
- listEl.appendChild(listItem);
- }
-});
diff --git a/notify-link-clicks-i18n/README.md b/notify-link-clicks-i18n/README.md
deleted file mode 100644
index b1a86d9..0000000
--- a/notify-link-clicks-i18n/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# notify-link-clicks-i18n
-
-**This add-on injects JavaScript into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does
-
-This extension includes:
-
-* a content script, "content-script.js", that is injected into all pages
-* a background script, "background-script.js"
-
-The content script listens for clicks in the page it's attached to.
-If a click is on a link, the content script sends the link's href
-to the background script.
-
-The background script listens for this message. When the background script
-receives the message, it displays a notification containing the href.
-
-The notification's content, as well as the extension's name and description, are
-localized into German, Dutch, and Japanese, as well as the default en-US.
-
-# What it shows
-
-* how to inject content scripts declaratively using manifest.json
-* how to send messages from a content script to a background script
-* how to display system notifications using the notifications API
-* how to use the internationalization (i18n) system
diff --git a/notify-link-clicks-i18n/_locales/de/messages.json b/notify-link-clicks-i18n/_locales/de/messages.json
deleted file mode 100644
index 708b995..0000000
--- a/notify-link-clicks-i18n/_locales/de/messages.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "extensionName": {
- "message": "Meine Beispielerweiterung",
- "description": "Name of the extension."
- },
-
- "extensionDescription": {
- "message": "Benachrichtigt den Benutzer über Linkklicks",
- "description": "Description of the extension."
- },
-
- "notificationTitle": {
- "message": "Klickbenachrichtigung",
- "description": "Title of the click notification."
- },
-
- "notificationContent": {
- "message": "Du hast $URL$ angeklickt",
- "description": "Tells the user which link they clicked.",
- "placeholders": {
- "url" : {
- "content" : "$1",
- "example" : "https://developer.mozilla.org"
- }
- }
- }
-}
diff --git a/notify-link-clicks-i18n/_locales/en/messages.json b/notify-link-clicks-i18n/_locales/en/messages.json
deleted file mode 100644
index 0f8832d..0000000
--- a/notify-link-clicks-i18n/_locales/en/messages.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "extensionName": {
- "message": "Notify link clicks i18n",
- "description": "Name of the extension."
- },
-
- "extensionDescription": {
- "message": "Shows a notification when the user clicks on links.",
- "description": "Description of the extension."
- },
-
- "notificationTitle": {
- "message": "Click notification",
- "description": "Title of the click notification."
- },
-
- "notificationContent": {
- "message": "You clicked $URL$.",
- "description": "Tells the user which link they clicked.",
- "placeholders": {
- "url" : {
- "content" : "$1",
- "example" : "https://developer.mozilla.org"
- }
- }
- }
-}
diff --git a/notify-link-clicks-i18n/_locales/ja/messages.json b/notify-link-clicks-i18n/_locales/ja/messages.json
deleted file mode 100644
index de5e783..0000000
--- a/notify-link-clicks-i18n/_locales/ja/messages.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "extensionName": {
- "message": "リンクを通知する",
- "description": "拡張機能の名前です。"
- },
-
- "extensionDescription": {
- "message": "ユーザーがリンクをクリックした時通知を表示します。",
- "description": "拡張機能の説明です。"
- },
-
- "notificationTitle": {
- "message": "クリック通知",
- "description": "pushのタイトルです。"
- },
-
- "notificationContent": {
- "message": "$URL$がクリックされました。",
- "description": "リンクをクリックした時通知を表示します。:変数$1にはurlが代入されます。",
- "placeholders": {
- "url" : {
- "content" : "$1",
- "example" : "https://developer.mozilla.org"
- }
- }
- }
-}
diff --git a/notify-link-clicks-i18n/_locales/nb_NO/messages.json b/notify-link-clicks-i18n/_locales/nb_NO/messages.json
deleted file mode 100644
index f685170..0000000
--- a/notify-link-clicks-i18n/_locales/nb_NO/messages.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "extensionName": {
- "message": "Varsling ved trykk på lenke i18n",
- "description": "Navn på utvidelsen."
- },
-
- "extensionDescription": {
- "message": "Viser en varsel når brukern trykker på en lenke",
- "description": "Beskrivelse av utvidelsen."
- },
-
- "notificationTitle": {
- "message": "Varseltrykk",
- "description": "Tittel på varselet."
- },
-
- "notificationContent": {
- "message": "Du trykket $URL$.",
- "description": "Forteller brukeren hvilken lenke som ble trykket.",
- "placeholders": {
- "url" : {
- "content" : "$1",
- "example" : "https://developer.mozilla.org"
- }
- }
- }
-}
diff --git a/notify-link-clicks-i18n/_locales/nl/messages.json b/notify-link-clicks-i18n/_locales/nl/messages.json
deleted file mode 100644
index dd1f51b..0000000
--- a/notify-link-clicks-i18n/_locales/nl/messages.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "extensionName": {
- "message": "Meld klikken op hyperlinks",
- "description": "Name of the extension."
- },
-
- "extensionDescription": {
- "message": "Toon een melding wanneer een gebruiker op hyperlinks klikt.",
- "description": "Description of the extension."
- },
-
- "notificationTitle": {
- "message": "Klikmelding",
- "description": "Title of the click notification."
- },
-
- "notificationContent": {
- "message": "U klikte op $URL$",
- "description": "Tells the user which link they clicked.",
- "placeholders": {
- "url" : {
- "content" : "$1",
- "example" : "https://developer.mozilla.org"
- }
- }
- }
-}
diff --git a/notify-link-clicks-i18n/_locales/pt_BR/messages.json b/notify-link-clicks-i18n/_locales/pt_BR/messages.json
deleted file mode 100644
index 7d1b64c..0000000
--- a/notify-link-clicks-i18n/_locales/pt_BR/messages.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "extensionName": {
- "message": "Notificação de cliques em links i18n",
- "description": "Nome da extensão."
- },
-
- "extensionDescription": {
- "message": "Mostra uma notificação quando o usuário clica nos links.",
- "description": "Descrição da extensão."
- },
-
- "notificationTitle": {
- "message": "Notificação de clique",
- "description": "Título da notificação de clique."
- },
-
- "notificationContent": {
- "message": "Você clicou em $URL$.",
- "description": "Informe aos usuários em qual link eles clicaram.",
- "placeholders": {
- "url" : {
- "content" : "$1",
- "example" : "https://developer.mozilla.org"
- }
- }
- }
-}
diff --git a/notify-link-clicks-i18n/background-script.js b/notify-link-clicks-i18n/background-script.js
deleted file mode 100644
index ead78ea..0000000
--- a/notify-link-clicks-i18n/background-script.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
-Log that we received the message.
-Then display a notification. The notification contains the URL,
-which we read from the message.
-*/
-function notify(message) {
- console.log("background script received message");
- var title = browser.i18n.getMessage("notificationTitle");
- var content = browser.i18n.getMessage("notificationContent", message.url);
- browser.notifications.create({
- "type": "basic",
- "iconUrl": browser.extension.getURL("icons/link-48.png"),
- "title": title,
- "message": content
- });
-}
-
-/*
-Assign `notify()` as a listener to messages from the content script.
-*/
-browser.runtime.onMessage.addListener(notify);
diff --git a/notify-link-clicks-i18n/content-script.js b/notify-link-clicks-i18n/content-script.js
deleted file mode 100644
index 8e9dd43..0000000
--- a/notify-link-clicks-i18n/content-script.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-If the click was on a link, send a message to the background page.
-The message contains the link's URL.
-*/
-function notifyExtension(e) {
- var target = e.target;
- while ((target.tagName != "A" || !target.href) && target.parentNode) {
- target = target.parentNode;
- }
- if (target.tagName != "A")
- return;
-
- console.log("content script sending message");
- browser.runtime.sendMessage({"url": target.href});
-}
-
-/*
-Add notifyExtension() as a listener to click events.
-*/
-window.addEventListener("click", notifyExtension);
diff --git a/notify-link-clicks-i18n/icons/LICENSE b/notify-link-clicks-i18n/icons/LICENSE
deleted file mode 100644
index 3bab068..0000000
--- a/notify-link-clicks-i18n/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The "link-48.png" icon is taken from the Geomicons iconset, and is used here under the MIT license: http://opensource.org/licenses/MIT.
diff --git a/notify-link-clicks-i18n/icons/link-48.png b/notify-link-clicks-i18n/icons/link-48.png
deleted file mode 100644
index 17d7da7..0000000
Binary files a/notify-link-clicks-i18n/icons/link-48.png and /dev/null differ
diff --git a/notify-link-clicks-i18n/manifest.json b/notify-link-clicks-i18n/manifest.json
deleted file mode 100644
index 6aa060f..0000000
--- a/notify-link-clicks-i18n/manifest.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-
- "manifest_version": 2,
- "name": "__MSG_extensionName__",
- "description": "__MSG_extensionDescription__",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n",
- "icons": {
- "48": "icons/link-48.png"
- },
-
- "permissions": ["notifications"],
-
- "background": {
- "scripts": ["background-script.js"]
- },
-
- "content_scripts": [
- {
- "matches": [""],
- "js": ["content-script.js"]
- }
- ],
-
- "default_locale": "en"
-}
diff --git a/open-my-page-button/README.md b/open-my-page-button/README.md
deleted file mode 100644
index 1f4bbe9..0000000
--- a/open-my-page-button/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# open-my-page
-
-## What it does
-
-This extension includes:
-
-* a background script, "background.js"
-* a browser action
-* a page "my-page.html"
-
-All it does is: when the user clicks the button, open "my-page.html" in a new tab.
-
-## 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/open-my-page-button/background.js b/open-my-page-button/background.js
deleted file mode 100644
index 8d8aab8..0000000
--- a/open-my-page-button/background.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
-Open a new tab, and load "my-page.html" into it.
-*/
-function openMyPage() {
- console.log("injecting");
- browser.tabs.create({
- "url": "/my-page.html"
- });
-}
-
-
-/*
-Add openMyPage() as a listener to clicks on the browser action.
-*/
-browser.browserAction.onClicked.addListener(openMyPage);
-
diff --git a/open-my-page-button/icons/LICENSE b/open-my-page-button/icons/LICENSE
deleted file mode 100644
index 20e821d..0000000
--- a/open-my-page-button/icons/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-
-The "page-32.png" and "page-48.png" icons are taken from the miu iconset created by Linh Pham Thi Dieu, and are used under the terms of its license: http://linhpham.me/miu/.
diff --git a/open-my-page-button/icons/page-32.png b/open-my-page-button/icons/page-32.png
deleted file mode 100644
index dae663d..0000000
Binary files a/open-my-page-button/icons/page-32.png and /dev/null differ
diff --git a/open-my-page-button/icons/page-48.png b/open-my-page-button/icons/page-48.png
deleted file mode 100644
index ba042cd..0000000
Binary files a/open-my-page-button/icons/page-48.png and /dev/null differ
diff --git a/open-my-page-button/manifest.json b/open-my-page-button/manifest.json
deleted file mode 100644
index 9b30e51..0000000
--- a/open-my-page-button/manifest.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-
- "description": "Adds browser action icon to toolbar to open packaged web page. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#open-my-page-button",
- "manifest_version": 2,
- "name": "open-my-page",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/open-my-page-button",
- "icons": {
- "48": "icons/page-48.png"
- },
-
- "background": {
- "scripts": ["background.js"]
- },
-
- "browser_action": {
- "default_icon": "icons/page-32.png"
- }
-
-}
diff --git a/open-my-page-button/my-page.html b/open-my-page-button/my-page.html
deleted file mode 100644
index e8c2274..0000000
--- a/open-my-page-button/my-page.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
It's my page!
-
-
-
diff --git a/page-to-extension-messaging/README.md b/page-to-extension-messaging/README.md
deleted file mode 100644
index e1c7761..0000000
--- a/page-to-extension-messaging/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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/page-to-extension-messaging/content-script.js b/page-to-extension-messaging/content-script.js
deleted file mode 100644
index 50cb715..0000000
--- a/page-to-extension-messaging/content-script.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-Listen for messages from the page.
-If the message was from the page script, show an alert.
-*/
-window.addEventListener("message", function(event) {
- if (event.source == window &&
- event.data.direction &&
- event.data.direction == "from-page-script") {
- alert("Content script received message: \"" + event.data.message + "\"");
- }
-});
-
-/*
-Send a message to the page script.
-*/
-function messagePageScript() {
- window.postMessage({
- direction: "from-content-script",
- message: "Message from the content script"
- }, "https://mdn.github.io");
-}
-
-/*
-Add messagePageScript() as a listener to click events on
-the "from-content-script" element.
-*/
-var fromContentScript = document.getElementById("from-content-script");
-fromContentScript.addEventListener("click", messagePageScript);
diff --git a/page-to-extension-messaging/icons/LICENSE b/page-to-extension-messaging/icons/LICENSE
deleted file mode 100644
index a414ec0..0000000
--- a/page-to-extension-messaging/icons/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-
-The "message-48.png" icon is taken from the miu iconset created by Linh Pham Thi Dieu, and is used under the terms of its license: http://linhpham.me/miu/.
diff --git a/page-to-extension-messaging/icons/message-48.png b/page-to-extension-messaging/icons/message-48.png
deleted file mode 100644
index cf77c5a..0000000
Binary files a/page-to-extension-messaging/icons/message-48.png and /dev/null differ
diff --git a/page-to-extension-messaging/manifest.json b/page-to-extension-messaging/manifest.json
deleted file mode 100644
index 9f5fd64..0000000
--- a/page-to-extension-messaging/manifest.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-
- "manifest_version": 2,
- "name": "Page to extension messaging",
- "description": "Visit https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html for the demo. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#page-to-extension-messaging",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/page-to-extension-messaging",
- "icons": {
- "48": "icons/message-48.png"
- },
-
- "content_scripts": [
- {
- "matches": ["https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html"],
- "js": ["content-script.js"]
- }
- ]
-
-}
diff --git a/quicknote/README.md b/quicknote/README.md
deleted file mode 100644
index 76de021..0000000
--- a/quicknote/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Quicknote
-A persistent note/to-do list application — click a button in your browser and record notes, which will persist even after browser restarts.
-
-Works in Firefox 47+, and will also work as a Chrome extension, out of the box.
-
-## What it does
-
-This extension includes:
-
-* A browser action that creates a popup — within the popup is:
- * Two form elements for entering title and body text for a new note, along with a button to add a note, and a button to clear all notes.
- * A list of the notes that have been added to the extension — each note includes a delete button to delete just that note. You can also click on the note title and body to edit them. In edit mode, each note includes:
- * An update button to submit an update.
- * A cancel button to cancel the update.
-
-Quicknote uses the WebExtensions [Storage API](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage) to persist the notes.
-
-## What it shows
-
-* How to persist data in a WebExtension using the Storage API.
diff --git a/quicknote/icons/quicknote-32.png b/quicknote/icons/quicknote-32.png
deleted file mode 100644
index 94af0b4..0000000
Binary files a/quicknote/icons/quicknote-32.png and /dev/null differ
diff --git a/quicknote/icons/quicknote-48.png b/quicknote/icons/quicknote-48.png
deleted file mode 100644
index f06b80c..0000000
Binary files a/quicknote/icons/quicknote-48.png and /dev/null differ
diff --git a/quicknote/manifest.json b/quicknote/manifest.json
deleted file mode 100644
index 6134678..0000000
--- a/quicknote/manifest.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-
- "manifest_version": 2,
- "name": "Quicknote",
- "version": "1.0",
-
- "description": "Allows the user to make quick notes by clicking a button and entering text into the resulting popup. The notes are saved in storage. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#quicknote",
- "icons": {
- "48": "icons/quicknote-48.png"
- },
-
- "permissions": [
- "storage"
- ],
-
- "browser_action": {
- "default_icon": {
- "32" : "icons/quicknote-32.png"
- },
- "default_title": "Quicknote",
- "default_popup": "popup/quicknote.html"
- }
-}
diff --git a/quicknote/popup/quicknote.css b/quicknote/popup/quicknote.css
deleted file mode 100644
index e2a0ed8..0000000
--- a/quicknote/popup/quicknote.css
+++ /dev/null
@@ -1,120 +0,0 @@
-/* General styling */
-
-* {
- box-sizing: border-box;
-}
-
-html {
- font-family: sans-serif;
- font-size: 10px;
- background: rgb(240,240,240);
- height: 300px;
- margin: 0;
-}
-
-body {
- width: 300px;
- background: rgb(240,240,240);
- margin: 0 auto;
- padding: 2px;
- height: inherit;
-}
-
-.outer-wrapper {
- overflow: auto;
- width: 100%;
- height: 290px;
- background: rgb(240,240,240);
-}
-
-.clearfix {
- clear: both;
-}
-
-/* form control styling */
-
-input, textarea, button {
- border: 1px solid rgb(218,218,218);
- padding: 4px;
- background: white;
- border-radius: 3px;
-}
-
-button {
- background: #ccc;
- box-shadow: inset -2px -2px 1px rgba(0,0,0,0.2);
- transition: 0.1s all;
-}
-
-button:hover, button:focus {
- background: #ddd;
-}
-
-button:active {
- box-shadow: inset -2px -2px 1px rgba(0,0,0,0.05);
-}
-
-input, textarea {
- font-family: sans-serif;
- box-shadow: inset 2px 2px 1px rgba(0,0,0,0.10);
-}
-
-/* Typography */
-
-h2 {
- font-size: 1.3rem;
-}
-
-p, input, textarea {
- font-size: 1.2rem;
- line-height: 1.5;
-}
-
-/* New notes entry box */
-
-.new-note {
- width: 100%;
- margin-bottom: 5px;
- padding: 2px;
-}
-
-input {
- width: 100%;
- margin-bottom: 2px;
-}
-
-textarea {
- width: 100%;
- margin-bottom: 4px;
- resize: none;
-}
-
-.clear {
- float: left;
-}
-
-.add {
- float: right;
-}
-
-/* Notes display box(es) */
-
-.note {
- padding: 2px;
-}
-
-.delete {
- float: right;
-}
-
-p {
- margin: 0;
-}
-
-.cancel {
- float: left;
-}
-
-.update {
- float: right;
-}
diff --git a/quicknote/popup/quicknote.html b/quicknote/popup/quicknote.html
deleted file mode 100644
index d816f55..0000000
--- a/quicknote/popup/quicknote.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/quicknote/popup/quicknote.js b/quicknote/popup/quicknote.js
deleted file mode 100644
index b94c29e..0000000
--- a/quicknote/popup/quicknote.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/* initialise variables */
-
-var inputTitle = document.querySelector('.new-note input');
-var inputBody = document.querySelector('.new-note textarea');
-
-var noteContainer = document.querySelector('.note-container');
-
-
-var clearBtn = document.querySelector('.clear');
-var addBtn = document.querySelector('.add');
-
-/* add event listeners to buttons */
-
-addBtn.addEventListener('click', addNote);
-clearBtn.addEventListener('click', clearAll);
-
-/* generic error handler */
-function onError(error) {
- console.log(error);
-}
-
-/* display previously-saved stored notes on startup */
-
-initialize();
-
-function initialize() {
- var gettingAllStorageItems = browser.storage.local.get(null);
- gettingAllStorageItems.then((results) => {
- var noteKeys = Object.keys(results);
- for(noteKey of noteKeys) {
- var curValue = results[noteKey];
- displayNote(noteKey,curValue);
- }
- }, onError);
-}
-
-/* Add a note to the display, and storage */
-
-function addNote() {
- var noteTitle = inputTitle.value;
- var noteBody = inputBody.value;
- var gettingItem = browser.storage.local.get(noteTitle);
- gettingItem.then((result) => {
- var objTest = Object.keys(result);
- if(objTest.length < 1 && noteTitle !== '' && noteBody !== '') {
- inputTitle.value = '';
- inputBody.value = '';
- storeNote(noteTitle,noteBody);
- }
- }, onError);
-}
-
-/* function to store a new note in storage */
-
-function storeNote(title, body) {
- var storingNote = browser.storage.local.set({ [title] : body });
- storingNote.then(() => {
- displayNote(title,body);
- }, onError);
-}
-
-/* function to display a note in the note box */
-
-function displayNote(title, body) {
-
- /* create note display box */
- var note = document.createElement('div');
- var noteDisplay = document.createElement('div');
- var noteH = document.createElement('h2');
- var notePara = document.createElement('p');
- var deleteBtn = document.createElement('button');
- var clearFix = document.createElement('div');
-
- note.setAttribute('class','note');
-
- noteH.textContent = title;
- notePara.textContent = body;
- deleteBtn.setAttribute('class','delete');
- deleteBtn.textContent = 'Delete note';
- clearFix.setAttribute('class','clearfix');
-
- noteDisplay.appendChild(noteH);
- noteDisplay.appendChild(notePara);
- noteDisplay.appendChild(deleteBtn);
- noteDisplay.appendChild(clearFix);
-
- note.appendChild(noteDisplay);
-
- /* set up listener for the delete functionality */
-
- deleteBtn.addEventListener('click',function(e){
- evtTgt = e.target;
- evtTgt.parentNode.parentNode.parentNode.removeChild(evtTgt.parentNode.parentNode);
- browser.storage.local.remove(title);
- })
-
- /* create note edit box */
- var noteEdit = document.createElement('div');
- var noteTitleEdit = document.createElement('input');
- var noteBodyEdit = document.createElement('textarea');
- var clearFix2 = document.createElement('div');
-
- var updateBtn = document.createElement('button');
- var cancelBtn = document.createElement('button');
-
- updateBtn.setAttribute('class','update');
- updateBtn.textContent = 'Update note';
- cancelBtn.setAttribute('class','cancel');
- cancelBtn.textContent = 'Cancel update';
-
- noteEdit.appendChild(noteTitleEdit);
- noteTitleEdit.value = title;
- noteEdit.appendChild(noteBodyEdit);
- noteBodyEdit.textContent = body;
- noteEdit.appendChild(updateBtn);
- noteEdit.appendChild(cancelBtn);
-
- noteEdit.appendChild(clearFix2);
- clearFix2.setAttribute('class','clearfix');
-
- note.appendChild(noteEdit);
-
- noteContainer.appendChild(note);
- noteEdit.style.display = 'none';
-
- /* set up listeners for the update functionality */
-
- noteH.addEventListener('click',function(){
- noteDisplay.style.display = 'none';
- noteEdit.style.display = 'block';
- })
-
- notePara.addEventListener('click',function(){
- noteDisplay.style.display = 'none';
- noteEdit.style.display = 'block';
- })
-
- cancelBtn.addEventListener('click',function(){
- noteDisplay.style.display = 'block';
- noteEdit.style.display = 'none';
- noteTitleEdit.value = title;
- noteBodyEdit.value = body;
- })
-
- updateBtn.addEventListener('click',function(){
- if(noteTitleEdit.value !== title || noteBodyEdit.value !== body) {
- updateNote(title,noteTitleEdit.value,noteBodyEdit.value);
- note.parentNode.removeChild(note);
- }
- });
-}
-
-
-/* function to update notes */
-
-function updateNote(delNote,newTitle,newBody) {
- var storingNote = browser.storage.local.set({ [newTitle] : newBody });
- storingNote.then(() => {
- if(delNote !== newTitle) {
- var removingNote = browser.storage.local.remove(delNote);
- removingNote.then(() => {
- displayNote(newTitle, newBody);
- }, onError);
- } else {
- displayNote(newTitle, newBody);
- }
- }, onError);
-}
-
-/* Clear all notes from the display/storage */
-
-function clearAll() {
- while (noteContainer.firstChild) {
- noteContainer.removeChild(noteContainer.firstChild);
- }
- browser.storage.local.clear();
-}
diff --git a/react-es6-popup/.babelrc b/react-es6-popup/.babelrc
deleted file mode 100644
index ffd1d11..0000000
--- a/react-es6-popup/.babelrc
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "presets": [
- "es2015",
- "stage-2",
- "react"
- ],
- "plugins": [
- "transform-class-properties",
- "transform-es2015-modules-commonjs"
- ]
-}
diff --git a/react-es6-popup/.gitignore b/react-es6-popup/.gitignore
deleted file mode 100644
index 20ccaa9..0000000
--- a/react-es6-popup/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# Ignore build artifacts and other files.
-.DS_Store
-yarn.lock
-extension/dist
-node_modules
diff --git a/react-es6-popup/.npmrc b/react-es6-popup/.npmrc
deleted file mode 100644
index a00908d..0000000
--- a/react-es6-popup/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-save-prefix=''
diff --git a/react-es6-popup/README.md b/react-es6-popup/README.md
deleted file mode 100644
index 5fa69cf..0000000
--- a/react-es6-popup/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# React / ES6 Popup Example
-
-## What it does
-
-This is an example of creating a browser action
-[popup](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Add_a_button_to_the_toolbar#Adding_a_popup)
-UI in [React][react] and [ES6](http://es6-features.org/) JavaScript.
-
-## What it shows
-
-* How to bundle [React][react] and any other [NodeJS][nodejs] module into an
- extension.
-* How to transpile code that is not supported natively in
- a browser such as
- [import / export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)
- syntax and [JSX](https://facebook.github.io/react/docs/jsx-in-depth.html).
-* How to continuously build code as you edit files.
-* How to customize [web-ext][web-ext] for your extension's specific needs.
-* How to structure your code in reusable ES6 modules.
-
-## Usage
-
-First, you need to change into the example subdirectory and install all
-[NodeJS][nodejs] dependencies with [npm](http://npmjs.com/) or
-[yarn](https://yarnpkg.com/):
-
- npm install
-
-Start the continuous build process to transpile the code into something that
-can run in Firefox or Chrome:
-
- npm run build
-
-This creates a WebExtension in the `extension` subdirectory.
-Any time you edit a file, it will be rebuilt automatically.
-
-In another shell window, run the extension in Firefox using a wrapper
-around [web-ext][web-ext]:
-
- npm start
-
-Any time you edit a file, [web-ext][web-ext] will reload the extension
-in Firefox. To see the popup, click the watermelon icon from the browser bar.
-Here is what it looks like:
-
-
-
-[react]: https://facebook.github.io/react/
-[nodejs]: https://nodejs.org/en/
-[web-ext]: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext
-
-## Icons
-
-The icon for this extension is provided by [icons8](https://icons8.com/).
diff --git a/react-es6-popup/extension/images/Watermelon-48.png b/react-es6-popup/extension/images/Watermelon-48.png
deleted file mode 100644
index 2821b3f..0000000
Binary files a/react-es6-popup/extension/images/Watermelon-48.png and /dev/null differ
diff --git a/react-es6-popup/extension/images/Watermelon-96.png b/react-es6-popup/extension/images/Watermelon-96.png
deleted file mode 100644
index 0b4f4f1..0000000
Binary files a/react-es6-popup/extension/images/Watermelon-96.png and /dev/null differ
diff --git a/react-es6-popup/extension/manifest.json b/react-es6-popup/extension/manifest.json
deleted file mode 100755
index 5126bdd..0000000
--- a/react-es6-popup/extension/manifest.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "manifest_version": 2,
- "name": "react-es6-popup-example",
- "version": "1.0",
-
- "browser_action": {
- "browser_style": true,
- "default_icon": {
- "48": "images/Watermelon-48.png",
- "96": "images/Watermelon-96.png"
- },
- "default_title": "React Example",
- "default_popup": "popup.html"
- },
-
- "permissions": ["activeTab"]
-}
diff --git a/react-es6-popup/extension/popup.css b/react-es6-popup/extension/popup.css
deleted file mode 100755
index 1b048c9..0000000
--- a/react-es6-popup/extension/popup.css
+++ /dev/null
@@ -1,8 +0,0 @@
-body {
- width: 400px;
- padding: 1em;
-}
-
-h1, h2 {
- border-bottom: 1px solid;
-}
diff --git a/react-es6-popup/extension/popup.html b/react-es6-popup/extension/popup.html
deleted file mode 100755
index a005aa0..0000000
--- a/react-es6-popup/extension/popup.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/react-es6-popup/package.json b/react-es6-popup/package.json
deleted file mode 100644
index e4930ae..0000000
--- a/react-es6-popup/package.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "react-es6-popup-example",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "build": "webpack -w -v --display-error-details --progress --colors",
- "start": "web-ext run -s extension/"
- },
- "author": "",
- "license": "MPL-2.0",
- "devDependencies": {
- "babel-core": "6.20.0",
- "babel-loader": "6.2.9",
- "babel-plugin-transform-class-properties": "6.19.0",
- "babel-plugin-transform-object-rest-spread": "6.20.2",
- "babel-preset-es2015": "6.18.0",
- "babel-preset-react": "6.16.0",
- "babel-preset-stage-2": "6.18.0",
- "react": "15.4.1",
- "react-dom": "15.4.1",
- "web-ext": "1.6.0",
- "webpack": "1.14.0"
- }
-}
diff --git a/react-es6-popup/screenshots/popup.png b/react-es6-popup/screenshots/popup.png
deleted file mode 100644
index 933d435..0000000
Binary files a/react-es6-popup/screenshots/popup.png and /dev/null differ
diff --git a/react-es6-popup/src/nested-component.js b/react-es6-popup/src/nested-component.js
deleted file mode 100644
index 1ca1496..0000000
--- a/react-es6-popup/src/nested-component.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-
-export default class Nested extends React.Component {
- render() {
- return (
-
-
Nested Component
-
- This is an example of a nested component that was imported via
- import / export syntax.
-
-
- );
- }
-}
diff --git a/react-es6-popup/src/popup.js b/react-es6-popup/src/popup.js
deleted file mode 100755
index 045a618..0000000
--- a/react-es6-popup/src/popup.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-
-import Nested from './nested-component';
-
-class Popup extends React.Component {
- constructor(props) {
- super(props);
- this.state = {activeTab: null};
- }
-
- componentDidMount() {
- // Get the active tab and store it in component state.
- chrome.tabs.query({active: true}, tabs => {
- this.setState({activeTab: tabs[0]});
- });
- }
-
- render() {
- const {activeTab} = this.state;
- return (
-
-
React Component
-
- This is an example of a popup UI in React.
-
-
- Active tab: {activeTab ? activeTab.url : '[waiting for result]'}
-
-
-
- );
- }
-}
-
-ReactDOM.render(, document.getElementById('app'));
diff --git a/react-es6-popup/webpack.config.js b/react-es6-popup/webpack.config.js
deleted file mode 100644
index c6decf7..0000000
--- a/react-es6-popup/webpack.config.js
+++ /dev/null
@@ -1,48 +0,0 @@
-const path = require('path');
-const webpack = require('webpack');
-
-module.exports = {
- entry: {
- // Each entry in here would declare a file that needs to be transpiled
- // and included in the extension source.
- // For example, you could add a background script like:
- // background: './src/background.js',
- popup: './src/popup.js',
- },
- output: {
- // This copies each source entry into the extension dist folder named
- // after its entry config key.
- path: 'extension/dist',
- filename: '[name].js',
- },
- module: {
- // This transpiles all code (except for third party modules) using Babel.
- loaders: [{
- exclude: /node_modules/,
- test: /\.js$/,
- // Babel options are in .babelrc
- loaders: ['babel'],
- }],
- },
- resolve: {
- // This allows you to import modules just like you would in a NodeJS app.
- extensions: ['', '.js', '.jsx'],
- root: [
- path.resolve(__dirname),
- ],
- modulesDirectories: [
- 'src',
- 'node_modules',
- ],
- },
- plugins: [
- // Since some NodeJS modules expect to be running in Node, it is helpful
- // to set this environment var to avoid reference errors.
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify('production'),
- }),
- ],
- // This will expose source map files so that errors will point to your
- // original source files instead of the transpiled files.
- devtool: 'sourcemap',
-};
diff --git a/selection-to-clipboard/README.md b/selection-to-clipboard/README.md
deleted file mode 100644
index 5169b7b..0000000
--- a/selection-to-clipboard/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# selection-to-clipboard
-
-**This add-on injects JavaScript into web pages. The `addons.mozilla.org` domain disallows this operation, so this add-on will not work properly when it's run on pages in the `addons.mozilla.org` domain.**
-
-## What it does
-
-This extension includes:
-
-* a content script, "content-script.js", that is injected into all pages
-
-The content script listens for text selections in the page it's attached to and copies the text to the clipboard on mouse-up.
-
-## What it shows
-
-* how to inject content scripts declaratively using manifest.json
-* how to write to the [clipboard](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard)
-
-## Note
-* If the `copySelection` function was in a browser event `clipboardWrite` permissions would be required e.g.
-```
-"permissions": ["clipboardWrite"]
-```
-See [Interact with the clipboard](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard.)
diff --git a/selection-to-clipboard/content-script.js b/selection-to-clipboard/content-script.js
deleted file mode 100644
index 8fb2598..0000000
--- a/selection-to-clipboard/content-script.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
-copy the selected text to clipboard
-*/
-function copySelection(e) {
- var selectedText = window.getSelection().toString().trim();
-
- if (selectedText) {
- document.execCommand("Copy");
- }
-}
-
-/*
-Add copySelection() as a listener to mouseup events.
-*/
-document.addEventListener("mouseup", copySelection);
\ No newline at end of file
diff --git a/selection-to-clipboard/icons/LICENSE b/selection-to-clipboard/icons/LICENSE
deleted file mode 100644
index 20e821d..0000000
--- a/selection-to-clipboard/icons/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-
-The "page-32.png" and "page-48.png" icons are taken from the miu iconset created by Linh Pham Thi Dieu, and are used under the terms of its license: http://linhpham.me/miu/.
diff --git a/selection-to-clipboard/icons/clipboard-48.png b/selection-to-clipboard/icons/clipboard-48.png
deleted file mode 100644
index 387f55f..0000000
Binary files a/selection-to-clipboard/icons/clipboard-48.png and /dev/null differ
diff --git a/selection-to-clipboard/manifest.json b/selection-to-clipboard/manifest.json
deleted file mode 100644
index 39f8b35..0000000
--- a/selection-to-clipboard/manifest.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "manifest_version": 2,
- "name": "selection-to-clipboard",
- "description": "Example of WebExtensionAPI for writing to the clipboard",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/selection-to-clipboard",
-
- "icons": {
- "48": "icons/clipboard-48.png"
- },
-
- "content_scripts": [{
- "matches": [""],
- "js": ["content-script.js"]
- }]
-}
diff --git a/tabs-tabs-tabs/README.md b/tabs-tabs-tabs/README.md
deleted file mode 100644
index 43d3cb5..0000000
--- a/tabs-tabs-tabs/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# tabs, tabs, tabs
-
-## What it does
-
-This extension includes a browser action with a popup specified as "tabs.html".
-
-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/tabs-tabs-tabs/manifest.json b/tabs-tabs-tabs/manifest.json
deleted file mode 100644
index 76663af..0000000
--- a/tabs-tabs-tabs/manifest.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "browser_action": {
- "browser_style": true,
- "default_title": "Tabs, tabs, tabs",
- "default_popup": "tabs.html"
- },
- "description": "A list of methods you can perform on a tab.",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/tabs-tabs-tabs",
- "manifest_version": 2,
- "name": "Tabs, tabs, tabs",
- "permissions": [
- "tabs"
- ],
- "version": "1.0"
-}
diff --git a/tabs-tabs-tabs/tabs.css b/tabs-tabs-tabs/tabs.css
deleted file mode 100644
index bfd9822..0000000
--- a/tabs-tabs-tabs/tabs.css
+++ /dev/null
@@ -1,20 +0,0 @@
-html, body {
- width: 350px;
-}
-
-a {
- margin: 10px;
- display: inline-block;
-}
-
-.switch-tabs {
- padding-left: 10px;
-}
-
-.switch-tabs a {
- display: block;
-}
-
-.panel {
- margin: 5px;
-}
diff --git a/tabs-tabs-tabs/tabs.html b/tabs-tabs-tabs/tabs.html
deleted file mode 100644
index 6113ed0..0000000
--- a/tabs-tabs-tabs/tabs.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tabs-tabs-tabs/tabs.js b/tabs-tabs-tabs/tabs.js
deleted file mode 100644
index dba3dfc..0000000
--- a/tabs-tabs-tabs/tabs.js
+++ /dev/null
@@ -1,206 +0,0 @@
-// Zoom constants. Define Max, Min, increment and default values
-const ZOOM_INCREMENT = 0.2;
-const MAX_ZOOM = 3;
-const MIN_ZOOM = 0.3;
-const DEFAULT_ZOOM = 1;
-
-function firstUnpinnedTab(tabs) {
- for (var tab of tabs) {
- if (!tab.pinned) {
- return tab.index;
- }
- }
-}
-
-/**
- * listTabs to switch to
- */
-function listTabs() {
- getCurrentWindowTabs().then((tabs) => {
- let tabsList = document.getElementById('tabs-list');
- let currentTabs = document.createDocumentFragment();
- let limit = 5;
- let counter = 0;
-
- tabsList.textContent = '';
-
- for (let tab of tabs) {
- if (!tab.active && counter <= limit) {
- let tabLink = document.createElement('a');
-
- tabLink.textContent = tab.title || tab.id;
- tabLink.setAttribute('href', tab.id);
- tabLink.classList.add('switch-tabs');
- currentTabs.appendChild(tabLink);
- }
-
- counter += 1;
- }
-
- tabsList.appendChild(currentTabs);
- });
-}
-
-document.addEventListener("DOMContentLoaded", listTabs);
-
-function getCurrentWindowTabs() {
- return browser.tabs.query({currentWindow: true});
-}
-
-document.addEventListener("click", function(e) {
- function callOnActiveTab(callback) {
- getCurrentWindowTabs().then((tabs) => {
- for (var tab of tabs) {
- if (tab.active) {
- callback(tab, tabs);
- }
- }
- });
-}
-
- if (e.target.id === "tabs-move-beginning") {
- callOnActiveTab((tab, tabs) => {
- var index = 0;
- if (!tab.pinned) {
- index = firstUnpinnedTab(tabs);
- }
- console.log(`moving ${tab.id} to ${index}`)
- browser.tabs.move([tab.id], {index});
- });
- }
-
- if (e.target.id === "tabs-move-end") {
- callOnActiveTab((tab, tabs) => {
- var index = -1;
- if (tab.pinned) {
- var lastPinnedTab = Math.max(0, firstUnpinnedTab(tabs) - 1);
- index = lastPinnedTab;
- }
- browser.tabs.move([tab.id], {index});
- });
- }
-
- else if (e.target.id === "tabs-duplicate") {
- callOnActiveTab((tab) => {
- browser.tabs.duplicate(tab.id);
- });
- }
-
- else if (e.target.id === "tabs-reload") {
- callOnActiveTab((tab) => {
- browser.tabs.reload(tab.id);
- });
- }
-
- else if (e.target.id === "tabs-remove") {
- callOnActiveTab((tab) => {
- browser.tabs.remove(tab.id);
- });
- }
-
- else if (e.target.id === "tabs-create") {
- browser.tabs.create({url: "https://developer.mozilla.org/en-US/Add-ons/WebExtensions"});
- }
-
- else if (e.target.id === "tabs-alertinfo") {
- callOnActiveTab((tab) => {
- let props = "";
- for (let item in tab) {
- props += `${ item } = ${ tab[item] } \n`;
- }
- alert(props);
- });
- }
-
- else if (e.target.id === "tabs-add-zoom") {
- callOnActiveTab((tab) => {
- var gettingZoom = browser.tabs.getZoom(tab.id);
- gettingZoom.then((zoomFactor) => {
- //the maximum zoomFactor is 3, it can't go higher
- if (zoomFactor >= MAX_ZOOM) {
- alert("Tab zoom factor is already at max!");
- } else {
- var newZoomFactor = zoomFactor + ZOOM_INCREMENT;
- //if the newZoomFactor is set to higher than the max accepted
- //it won't change, and will never alert that it's at maximum
- newZoomFactor = newZoomFactor > MAX_ZOOM ? MAX_ZOOM : newZoomFactor;
- browser.tabs.setZoom(tab.id, newZoomFactor);
- }
- });
- });
- }
-
- else if (e.target.id === "tabs-decrease-zoom") {
- callOnActiveTab((tab) => {
- var gettingZoom = browser.tabs.getZoom(tab.id);
- gettingZoom.then((zoomFactor) => {
- //the minimum zoomFactor is 0.3, it can't go lower
- if (zoomFactor <= MIN_ZOOM) {
- alert("Tab zoom factor is already at minimum!");
- } else {
- var newZoomFactor = zoomFactor - ZOOM_INCREMENT;
- //if the newZoomFactor is set to lower than the min accepted
- //it won't change, and will never alert that it's at minimum
- newZoomFactor = newZoomFactor < MIN_ZOOM ? MIN_ZOOM : newZoomFactor;
- browser.tabs.setZoom(tab.id, newZoomFactor);
- }
- });
- });
- }
-
- else if (e.target.id === "tabs-default-zoom") {
- callOnActiveTab((tab) => {
- var gettingZoom = browser.tabs.getZoom(tab.id);
- gettingZoom.then((zoomFactor) => {
- if (zoomFactor == DEFAULT_ZOOM) {
- alert("Tab zoom is already at the default zoom factor");
- } else {
- browser.tabs.setZoom(tab.id, DEFAULT_ZOOM);
- }
- });
- });
- }
- // Currently (11/2/2016) only supported by Chrome
- else if (e.target.id === "tabs-highlight") { // highlights current tab and next tab (cycles back to first tab if current tab is the last one)
- callOnActiveTab((tab, tabs) => {
- next = (tab.index+1) % tabs.length;
- browser.tabs.highlight({tabs:[tab.index, next]});
- });
- }
-
- else if (e.target.classList.contains('switch-tabs')) {
- var tabId = +e.target.getAttribute('href');
-
- chrome.tabs.query({
- currentWindow: true
- }, function(tabs) {
- for (var tab of tabs) {
- if (tab.id === tabId) {
- chrome.tabs.update(tabId, {
- active: true
- });
- }
- }
- });
- }
-
- e.preventDefault();
-});
-
-//onRemoved listener. fired when tab is removed
-browser.tabs.onRemoved.addListener(function(tabId, removeInfo){
- console.log(`The tab with id: ${tabId}, is closing`);
-
- if(removeInfo.isWindowClosing) {
- console.log(`Its window is also closing.`);
- } else {
- console.log(`Its window is not closing`);
- }
-});
-
-//onMoved listener. fired when tab is moved into the same window
-browser.tabs.onMoved.addListener(function(tabId, moveInfo){
- var startIndex = moveInfo.fromIndex;
- var endIndex = moveInfo.toIndex;
- console.log(`Tab with id: ${tabId} moved from index: ${startIndex} to index: ${endIndex}`);
-});
diff --git a/user-agent-rewriter/README.md b/user-agent-rewriter/README.md
deleted file mode 100644
index 844afa8..0000000
--- a/user-agent-rewriter/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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 "https://httpbin.org", for example: https://httpbin.org/user-agent
-
-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 https://httpbin.org/.
-
-## 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
diff --git a/user-agent-rewriter/background.js b/user-agent-rewriter/background.js
deleted file mode 100644
index c345a08..0000000
--- a/user-agent-rewriter/background.js
+++ /dev/null
@@ -1,49 +0,0 @@
-"use strict";
-
-/*
-This is the page for which we want to rewrite the User-Agent header.
-*/
-var targetPage = "https://httpbin.org/*";
-
-/*
-Map browser names to UA strings.
-*/
-var uaStrings = {
- "Firefox 41": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0",
- "Chrome 41": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",
- "IE 11": "Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko"
-}
-
-/*
-Initialize the UA to Firefox 41.
-*/
-var ua = uaStrings["Firefox 41"];
-
-/*
-Rewrite the User-Agent header to "ua".
-*/
-function rewriteUserAgentHeader(e) {
- for (var header of e.requestHeaders) {
- if (header.name.toLowerCase() === "user-agent") {
- header.value = ua;
- }
- }
- return {requestHeaders: e.requestHeaders};
-}
-
-/*
-Add rewriteUserAgentHeader as a listener to onBeforeSendHeaders,
-only for the target page.
-
-Make it "blocking" so we can modify the headers.
-*/
-browser.webRequest.onBeforeSendHeaders.addListener(rewriteUserAgentHeader,
- {urls: [targetPage]},
- ["blocking", "requestHeaders"]);
-
-/*
-Update ua to a new value, mapped from the uaString parameter.
-*/
-function setUaString(uaString) {
- ua = uaStrings[uaString];
-}
diff --git a/user-agent-rewriter/icons/LICENSE b/user-agent-rewriter/icons/LICENSE
deleted file mode 100644
index 18fae49..0000000
--- a/user-agent-rewriter/icons/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-The "person-32.png" "person-48.png" icons are taken from the Ionicons iconset (http://ionicons.com/), and are used here under the MIT license: http://opensource.org/licenses/MIT.
diff --git a/user-agent-rewriter/icons/person-32.png b/user-agent-rewriter/icons/person-32.png
deleted file mode 100644
index 38a16bd..0000000
Binary files a/user-agent-rewriter/icons/person-32.png and /dev/null differ
diff --git a/user-agent-rewriter/icons/person-48.png b/user-agent-rewriter/icons/person-48.png
deleted file mode 100644
index 0cb787b..0000000
Binary files a/user-agent-rewriter/icons/person-48.png and /dev/null differ
diff --git a/user-agent-rewriter/manifest.json b/user-agent-rewriter/manifest.json
deleted file mode 100644
index b0cd035..0000000
--- a/user-agent-rewriter/manifest.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-
- "description": "Adds browser action icon to toolbar to choose user agent string from popup menu. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#user-agent-rewriter",
- "manifest_version": 2,
- "name": "user-agent-rewriter",
- "version": "1.0",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/user-agent-rewriter",
- "icons": {
- "48": "icons/person-48.png"
- },
-
- "permissions": [
- "webRequest", "webRequestBlocking", "http://useragentstring.com/*"
- ],
-
- "background": {
- "scripts": ["background.js"]
- },
-
- "browser_action": {
- "default_icon": "icons/person-32.png",
- "default_title": "Choose a user agent",
- "default_popup": "popup/choose_ua.html"
- }
-
-}
diff --git a/user-agent-rewriter/popup/choose_ua.css b/user-agent-rewriter/popup/choose_ua.css
deleted file mode 100644
index 9e15677..0000000
--- a/user-agent-rewriter/popup/choose_ua.css
+++ /dev/null
@@ -1,23 +0,0 @@
-html, body, .ua-choices {
- height: 100px;
- width: 120px;
- margin: 0;
-}
-
-.ua-choices {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
-}
-
-.ua-choice {
- height: 20%;
- margin: 0.2em;
- padding: 0.2em;
- background-color: #E5F2F2;
- cursor: pointer;
-}
-
-.ua-choice:hover {
- background-color: #CFF2F2;
-}
diff --git a/user-agent-rewriter/popup/choose_ua.html b/user-agent-rewriter/popup/choose_ua.html
deleted file mode 100644
index 837307d..0000000
--- a/user-agent-rewriter/popup/choose_ua.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
Firefox 41
-
Chrome 41
-
IE 11
-
-
-
-
-
-
diff --git a/user-agent-rewriter/popup/choose_ua.js b/user-agent-rewriter/popup/choose_ua.js
deleted file mode 100644
index baaddaf..0000000
--- a/user-agent-rewriter/popup/choose_ua.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-/*
-If the user clicks on an element which has the class "ua-choice":
-* fetch the element's textContent: for example, "IE 11"
-* pass it into the background page's setUaString() function
-*/
-document.addEventListener("click", function(e) {
- if (!e.target.classList.contains("ua-choice")) {
- return;
- }
-
- var chosenUa = e.target.textContent;
- var backgroundPage = browser.extension.getBackgroundPage();
- backgroundPage.setUaString(chosenUa);
-});
diff --git a/webpack-modules/README.md b/webpack-modules/README.md
deleted file mode 100644
index de261bd..0000000
--- a/webpack-modules/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# WebExtension Webpack Example
-A minimal example of how to use [webpack](https://webpack.github.io) to package
-[npm](https://npmjs.com) modules so they can be used in a WebExtension.
-The example package used by this extension is `left-pad`, an essential package
-in almost any situation.
-
-## What it does
-This example shows how to use a node module in a background and a content script.
-It defines two build targets in [webpack.config.js](webpack.config.js), they each
-generate a file that includes all modules used the entry point and store it in
-the [addon](addon/) folder. The first one starts with [background_scripts/background.js](background_scripts/background.js)
-and stores it in `addon/background_scripts/index.js`. The other one does the
-same for [popup/left-pad.js](popup/left-pad.js) and stores it in `addon/popup/index.js`.
-
-The extension includes a browser action with a popup, which provides an UI for
-running left-pad on a string with a chosen character. The operation can either be
-performed with the left-pad module included in the panel's script or in the
-background script.
-
-## What it could do
-This could be infinitely extended - injecting global jQuery, adding babel,
-react/jsx, css modules, image processing, local modules and so on.
-
-## What it shows
-
- - How to use npm or custom modules in a WebExtension.
-
-## How to build it
-
- - `npm install`
- - `npm run build`
-
-The WebExtension in the [addon](addon/) folder should now work.
-
-## What about Browserify?
-Browserify works just as well as webpack for extensions, in the end it's a
-personal choice about your prefered tool.
-
-## Live-development
-Additionally to watching the folder with your `manifest.json` in it, you will also
-have to run webpack in watch mode.
diff --git a/webpack-modules/addon/icons/leftpad-32.png b/webpack-modules/addon/icons/leftpad-32.png
deleted file mode 100644
index 4987e78..0000000
Binary files a/webpack-modules/addon/icons/leftpad-32.png and /dev/null differ
diff --git a/webpack-modules/addon/manifest.json b/webpack-modules/addon/manifest.json
deleted file mode 100644
index 62ae79f..0000000
--- a/webpack-modules/addon/manifest.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "manifest_version": 2,
- "name": "Webpack Example",
- "version": "1.0.0",
- "description": "A minimal example of how to use npm modules from within a WebExtension.",
- "icons": {
- "32": "icons/leftpad-32.png"
- },
- "browser_action": {
- "default_icon": "icons/leftpad-32.png",
- "default_title": "Left Pad",
- "default_popup": "popup/left-pad.html",
- "browser_style": true
- },
- "background": {
- "scripts": ["background_scripts/index.js"]
- }
-}
diff --git a/webpack-modules/addon/popup/left-pad.html b/webpack-modules/addon/popup/left-pad.html
deleted file mode 100644
index 8fb2e2a..0000000
--- a/webpack-modules/addon/popup/left-pad.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/webpack-modules/addon/popup/style.css b/webpack-modules/addon/popup/style.css
deleted file mode 100644
index 463a919..0000000
--- a/webpack-modules/addon/popup/style.css
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * These styles extend the styles from browser_styles, see https://firefoxux.github.io/StyleGuide.
- */
-
-/* For some reason the footer creates a horizontal overflow */
-body {
- overflow-x: hidden;
-}
-
-.panel-formElements-item label {
- width: 80px;
-}
-
-.panel-formElements-item output,
-.panel-formElements-item input[type="number"] {
- flex-grow: 1;
-}
-
-input[type="number"] {
- background-color: #fff;
- border: 1px solid #b1b1b1;
- box-shadow: 0 0 0 0 rgba(97, 181, 255, 0);
- font: caption;
- padding: 0 6px 0;
- transition-duration: 250ms;
- transition-property: box-shadow;
- height: 24px;
-}
-
-input[type="number"]:hover {
- border-color: #858585;
-}
-
-input[type="number"]:focus {
- border-color: #0996f8;
- box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75);
-}
-
-/* Reset the default styles for buttons if it's a footer button */
-button.panel-section-footer-button {
- padding: 12px;
-}
diff --git a/webpack-modules/background_scripts/background.js b/webpack-modules/background_scripts/background.js
deleted file mode 100644
index 7af7653..0000000
--- a/webpack-modules/background_scripts/background.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const leftPad = require("left-pad");
-
-browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
- const result = leftPad(message.text, message.amount, message.with);
- sendResponse(result);
-});
diff --git a/webpack-modules/package.json b/webpack-modules/package.json
deleted file mode 100644
index c4915ed..0000000
--- a/webpack-modules/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "webpack-webextension",
- "version": "1.0.0",
- "description": "A minimal example of how to use npm modules from within a WebExtension.",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "build": "webpack"
- },
- "license": "MPL-2.0",
- "devDependencies": {
- "webpack": "^1.13.1"
- },
- "dependencies": {
- "left-pad": "^1.1.1"
- }
-}
diff --git a/webpack-modules/popup/left-pad.js b/webpack-modules/popup/left-pad.js
deleted file mode 100644
index 766d1a4..0000000
--- a/webpack-modules/popup/left-pad.js
+++ /dev/null
@@ -1,24 +0,0 @@
-const leftPad = require("left-pad");
-
-const resultNode = document.getElementById("result");
-const textNode = document.getElementById("text");
-const amountNode = document.getElementById("amount");
-const withNode = document.getElementById("with");
-
-document.getElementById("leftpad-form").addEventListener("submit", (e) => {
- e.preventDefault();
-
- console.log("padding");
- resultNode.value = leftPad(textNode.value, amountNode.valueAsNumber, withNode.value);
-}, false);
-
-document.getElementById("pad-bg").addEventListener("click", (e) => {
- var sendingMessage = browser.runtime.sendMessage({
- text: textNode.value,
- amount: amountNode.valueAsNumber,
- with: withNode.value
- });
- sendingMessage.then((result) => {
- resultNode.value = result;
- });
-});
diff --git a/webpack-modules/webpack.config.js b/webpack-modules/webpack.config.js
deleted file mode 100644
index 03bf28d..0000000
--- a/webpack-modules/webpack.config.js
+++ /dev/null
@@ -1,10 +0,0 @@
-module.exports = {
- entry: {
- background_scripts: "./background_scripts/background.js",
- popup: "./popup/left-pad.js"
- },
- output: {
- path: "addon",
- filename: "[name]/index.js"
- }
-};
diff --git a/window-manipulator/README.md b/window-manipulator/README.md
deleted file mode 100644
index 46d37cf..0000000
--- a/window-manipulator/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Window manipulator
-
-## What it does
-
-This extension includes a browser action with a popup specified as "window.html".
-
-The popup lets the user perform various simple operations using the windows API.
-
-# What it shows
-
-Demonstration of various windows API functions.
diff --git a/window-manipulator/icons/window.png b/window-manipulator/icons/window.png
deleted file mode 100644
index e707a11..0000000
Binary files a/window-manipulator/icons/window.png and /dev/null differ
diff --git a/window-manipulator/icons/window19.png b/window-manipulator/icons/window19.png
deleted file mode 100644
index 8207534..0000000
Binary files a/window-manipulator/icons/window19.png and /dev/null differ
diff --git a/window-manipulator/icons/window38.png b/window-manipulator/icons/window38.png
deleted file mode 100644
index b42ab1e..0000000
Binary files a/window-manipulator/icons/window38.png and /dev/null differ
diff --git a/window-manipulator/icons/window@2x.png b/window-manipulator/icons/window@2x.png
deleted file mode 100644
index 9a5044e..0000000
Binary files a/window-manipulator/icons/window@2x.png and /dev/null differ
diff --git a/window-manipulator/manifest.json b/window-manipulator/manifest.json
deleted file mode 100644
index 5963b9b..0000000
--- a/window-manipulator/manifest.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "browser_action": {
- "browser_style": true,
- "default_title": "Window manipulator",
- "default_popup": "window.html",
- "default_icon": {
- "19": "icons/window19.png",
- "38": "icons/window38.png"
- }
- },
- "icons": {
- "48": "icons/window.png",
- "96": "icons/window@2x.png"
- },
- "description": "A list of methods you can perform on a window.",
- "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/window-manipulator",
- "manifest_version": 2,
- "name": "Window manipulator",
- "version": "1.0"
-}
diff --git a/window-manipulator/window.css b/window-manipulator/window.css
deleted file mode 100644
index 959491f..0000000
--- a/window-manipulator/window.css
+++ /dev/null
@@ -1,12 +0,0 @@
-html, body {
- width: 350px;
-}
-
-a {
- margin: 10px;
- display: inline-block;
-}
-
-.panel {
- margin: 5px;
-}
diff --git a/window-manipulator/window.html b/window-manipulator/window.html
deleted file mode 100644
index 8faa3ad..0000000
--- a/window-manipulator/window.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-