diff --git a/menu-labelled-open/README.md b/menu-labelled-open/README.md
new file mode 100644
index 0000000..794ba75
--- /dev/null
+++ b/menu-labelled-open/README.md
@@ -0,0 +1,13 @@
+# menu-labelled-open
+
+## What it does
+
+This extension adds a menu item that's shown when the context menu is shown over a link. When the item is clicked, it just opens the link in the current tab.
+
+The extension also listens for the `onShown` event: when this event is fired, the extension gets the hostname for the link and displays it in the menu item's title, so the user knows the hostname for the link they are thinking of clicking.
+
+## What it shows
+
+This extension is a demo of the [`menus.onShown` ](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/onShown) and [`menus.refresh()`](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/refresh) features of the `menus` API.
+
+The `onShown` event enables extensions to be notified when the menu is shown. At that point they are able to add, remove, or update their menu items, then refresh the menu using `refresh()`.
diff --git a/menu-labelled-open/background.js b/menu-labelled-open/background.js
new file mode 100644
index 0000000..d49db64
--- /dev/null
+++ b/menu-labelled-open/background.js
@@ -0,0 +1,33 @@
+'use strict';
+
+const openLabelledId = "open-labelled";
+
+browser.menus.create({
+ id: openLabelledId,
+ title: "Open",
+ contexts: ["link"]
+});
+
+browser.menus.onClicked.addListener((info, tab) => {
+ if (info.menuItemId === openLabelledId) {
+ browser.tabs.update(tab.id, {
+ url: info.linkUrl
+ });
+ }
+});
+
+async function updateMenuItem(linkHostname) {
+ await browser.menus.update(openLabelledId, {
+ title: `Open (${linkHostname})`
+ });
+ await browser.menus.refresh();
+}
+
+browser.menus.onShown.addListener(info => {
+ if (!info.linkUrl) {
+ return;
+ }
+ let linkElement = document.createElement("a");
+ linkElement.href = info.linkUrl;
+ updateMenuItem(linkElement.hostname);
+});
diff --git a/menu-labelled-open/icon/LICENSE b/menu-labelled-open/icon/LICENSE
new file mode 100644
index 0000000..ac3e8fc
--- /dev/null
+++ b/menu-labelled-open/icon/LICENSE
@@ -0,0 +1 @@
+The "label.svg" icon is taken from the PICOL iconset (http://www.picol.org/) and is used here under the terms of the Creative Commons Attribution-ShareAlike 3.0 license (https://creativecommons.org/licenses/by-sa/3.0/).
diff --git a/menu-labelled-open/icon/label.svg b/menu-labelled-open/icon/label.svg
new file mode 100644
index 0000000..4757739
--- /dev/null
+++ b/menu-labelled-open/icon/label.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/menu-labelled-open/manifest.json b/menu-labelled-open/manifest.json
new file mode 100644
index 0000000..d5b3b2d
--- /dev/null
+++ b/menu-labelled-open/manifest.json
@@ -0,0 +1,27 @@
+{
+
+ "manifest_version": 2,
+ "name": "Labelled open",
+ "description": "Adds a context menu item that labels links with the hostname. Demo of onShown and refresh().",
+ "version": "1.0",
+ "applications": {
+ "gecko": {
+ "strict_min_version": "60.0a1"
+ }
+ },
+ "icons": {
+ "16": "icon/label.svg",
+ "32": "icon/label.svg",
+ "48": "icon/label.svg"
+ },
+
+ "background": {
+ "scripts": ["background.js"]
+ },
+
+ "permissions": [
+ "menus",
+ ""
+ ]
+
+}