Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
e950136ad2 | |||
3fcdc86679 | |||
1efcc58dc8 | |||
dd8c8b8d2c | |||
9c12be5c90 | |||
b0541bea2a | |||
16253ceea9 |
7
LICENSE
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
Copyright 2024 Rose / Tangent
|
||||||
|
|
||||||
|
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.
|
@ -25,7 +25,7 @@ var shuffle = function (array) {
|
|||||||
return array;
|
return array;
|
||||||
};
|
};
|
||||||
|
|
||||||
browser.browserAction.onClicked.addListener(function() {
|
browser.action.onClicked.addListener(function() {
|
||||||
browser.tabs.query({}, function(tabs) {
|
browser.tabs.query({}, function(tabs) {
|
||||||
let count = Math.floor(tabs.length / 2) + 1 // I don't remember why we need an extra +1 here, but it is necessary
|
let count = Math.floor(tabs.length / 2) + 1 // I don't remember why we need an extra +1 here, but it is necessary
|
||||||
var ok = confirm("Are you sure you want to close " + count + " tabs?")
|
var ok = confirm("Are you sure you want to close " + count + " tabs?")
|
||||||
@ -44,7 +44,7 @@ browser.browserAction.onClicked.addListener(function() {
|
|||||||
function updateCount() {
|
function updateCount() {
|
||||||
browser.tabs.query({}, function(tabs) {
|
browser.tabs.query({}, function(tabs) {
|
||||||
let count = Math.floor(tabs.length / 2)
|
let count = Math.floor(tabs.length / 2)
|
||||||
browser.browserAction.setBadgeText({ text: "" + count })
|
browser.action.setBadgeText({ text: "" + count })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 546 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "The Snap",
|
"name": "The Snap",
|
||||||
"description": "Too many tabs open? Halve your workload.",
|
"description": "Too many tabs open? Halve your workload.",
|
||||||
"version": "1.1",
|
"version": "1.1.3",
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "images/gauntlet16.png",
|
"16": "images/gauntlet16.png",
|
||||||
"48": "images/gauntlet48.png",
|
"48": "images/gauntlet48.png",
|
||||||
@ -21,6 +21,14 @@
|
|||||||
"background": {
|
"background": {
|
||||||
"service_worker": "background.js",
|
"service_worker": "background.js",
|
||||||
"scripts": [ "background.js" ],
|
"scripts": [ "background.js" ],
|
||||||
"persistent": true
|
"persistent": false
|
||||||
|
},
|
||||||
|
"browser_specific_settings": {
|
||||||
|
"gecko": {
|
||||||
|
"id": "{7b9819b6-6bd3-4cb8-a5b3-9ae6eb2e75ea}"
|
||||||
|
},
|
||||||
|
"gecko_android": {
|
||||||
|
"id": "{7b9819b6-6bd3-4cb8-a5b3-9ae6eb2e75e0}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |