Added initial extension
15
background.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function announce_close(){
|
||||||
|
console.log("closing all search tabs")
|
||||||
|
chrome.tabs.query({}, function(tabs) {
|
||||||
|
var closeable=[];
|
||||||
|
for (var i=0; i<tabs.length; ++i) {
|
||||||
|
console.log(tabs[i]);
|
||||||
|
if(tabs[i].url.includes("https://www.google.com/search?"))
|
||||||
|
{
|
||||||
|
closeable.push(tabs[i].id)
|
||||||
|
}
|
||||||
|
chrome.tabs.remove(closeable);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
chrome.browserAction.onClicked.addListener(function(tab){announce_close()});
|
BIN
docs/screenCapture.png
Normal file
After Width: | Height: | Size: 105 KiB |
26
manifest.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"manifest_version": 2,
|
||||||
|
"name": "Close Search Tabs",
|
||||||
|
"description": "Closes all Google Search tabs when clicked to free up tabs and save your sanity.",
|
||||||
|
"short_name":"SearchBGon",
|
||||||
|
"author": "Tai Groot",
|
||||||
|
"version": "1.0.2",
|
||||||
|
"browser_action": {
|
||||||
|
"default_icon": "static/icon.png"
|
||||||
|
},
|
||||||
|
"background": {
|
||||||
|
"scripts": [
|
||||||
|
"background.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"permissions": [
|
||||||
|
"tabs"
|
||||||
|
],
|
||||||
|
"icons": {
|
||||||
|
"16": "static/icon-16.png",
|
||||||
|
"32": "static/icon-32.png",
|
||||||
|
"48": "static/icon-48.png",
|
||||||
|
"64": "static/icon-64.png",
|
||||||
|
"128": "static/icon-128.png"
|
||||||
|
}
|
||||||
|
}
|
BIN
static/icon-128.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
static/icon-16.png
Normal file
After Width: | Height: | Size: 641 B |
BIN
static/icon-32.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
static/icon-48.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
static/icon-64.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
static/icon.png
Normal file
After Width: | Height: | Size: 48 KiB |