From 88ebb9e2aff7c0ce604e5e9455611a49979f0526 Mon Sep 17 00:00:00 2001 From: amysteamdev <37001393+AmySteam@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:15:41 -0600 Subject: [PATCH] Removes duplicate legacy hello-world (#799) --- examples/hello-world/background.js | 32 ------------------------------ examples/hello-world/hello.html | 9 --------- examples/hello-world/manifest.json | 9 --------- 3 files changed, 50 deletions(-) delete mode 100644 examples/hello-world/background.js delete mode 100644 examples/hello-world/hello.html delete mode 100644 examples/hello-world/manifest.json diff --git a/examples/hello-world/background.js b/examples/hello-world/background.js deleted file mode 100644 index 688a7904..00000000 --- a/examples/hello-world/background.js +++ /dev/null @@ -1,32 +0,0 @@ -// Extension event listeners are a little different from the patterns you may have seen in DOM or -// Node.js APIs. The below event listener registration can be broken in to 4 distinct parts: -// -// * chrome - the global namespace for Chrome's extension APIs -// * runtime – the namespace of the specific API we want to use -// * onInstalled - the event we want to subscribe to -// * addListener - what we want to do with this event -// -// See https://developer.chrome.com/docs/extensions/reference/events/ for additional details. -chrome.runtime.onInstalled.addListener(async () => { - - // While we could have used `let url = "hello.html"`, using runtime.getURL is a bit more robust as - // it returns a full URL rather than just a path that Chrome needs to be resolved contextually at - // runtime. - let url = chrome.runtime.getURL("hello.html"); - - // Open a new tab pointing at our page's URL using JavaScript's object initializer shorthand. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#new_notations_in_ecmascript_2015 - // - // Many of the extension platform's APIs are asynchronous and can either take a callback argument - // or return a promise. Since we're inside an async function, we can await the resolution of the - // promise returned by the tabs.create call. See the following link for more info on async/await. - // https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await - let tab = await chrome.tabs.create({ url }); - - // Finally, let's log the ID of the newly created tab using a template literal. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals - // - // To view this log message, open chrome://extensions, find "Hello, World!", and click the - // "service worker" link in the card to open DevTools. - console.log(`Created tab ${tab.id}`); -}); diff --git a/examples/hello-world/hello.html b/examples/hello-world/hello.html deleted file mode 100644 index 137998af..00000000 --- a/examples/hello-world/hello.html +++ /dev/null @@ -1,9 +0,0 @@ - - -
-Hello, World!
- - diff --git a/examples/hello-world/manifest.json b/examples/hello-world/manifest.json deleted file mode 100644 index 73a1d9a3..00000000 --- a/examples/hello-world/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Hello, World!", - "version": "1.0", - "manifest_version": 3, - "background": { - "service_worker": "background.js" - }, - "action": {} -}