diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..57744dd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Erisa (ErisaMoe) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/background.js b/background.js new file mode 100644 index 0000000..190ff42 --- /dev/null +++ b/background.js @@ -0,0 +1,7 @@ +browser.browserAction.onClicked.addListener(onClick); + +function onClick(tab) { + browser.tabs.create({ + url: "tabs.html" + }) +} diff --git a/icons/logo-256.png b/icons/logo-256.png new file mode 100644 index 0000000..16b2ff3 Binary files /dev/null and b/icons/logo-256.png differ diff --git a/icons/logo-48.png b/icons/logo-48.png new file mode 100644 index 0000000..189bb80 Binary files /dev/null and b/icons/logo-48.png differ diff --git a/icons/logo-96.png b/icons/logo-96.png new file mode 100644 index 0000000..1ac1b43 Binary files /dev/null and b/icons/logo-96.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..bc5f96d --- /dev/null +++ b/manifest.json @@ -0,0 +1,28 @@ +{ + "manifest_version": 2, + "name": "Save All Tab URLs", + "description": "Get the raw URLs of all your open tabs!", + "version": "0.1.3", + + "background": { + "scripts": ["background.js"] + }, + + "icons": { + "48": "icons/logo-48.png", + "96": "icons/logo-96.png", + "256": "icons/logo-256.png" + }, + + "browser_action": { + "default_icon": { + "48": "icons/logo-48.png", + "96": "icons/logo-96.png", + "256": "icons/logo-256.png" + } + }, + + "permissions": [ + "tabs" + ] +} diff --git a/script.js b/script.js new file mode 100644 index 0000000..f4fe8a4 --- /dev/null +++ b/script.js @@ -0,0 +1,12 @@ +browser.tabs.query({}).then(function(value) { + var tabsArray = []; + for (i = 0; i < value.length; i++) { + console.log(value); + if (!value[i].active) { + tabsArray.push(value[i].url); + } + } + var links = document.createElement('pre'); + document.body.appendChild(links); + links.textContent = tabsArray.join("\n"); +}); diff --git a/tabs.html b/tabs.html new file mode 100644 index 0000000..21d7cb5 --- /dev/null +++ b/tabs.html @@ -0,0 +1,7 @@ + +
+