var oldWindowStates={};
function launch(url, query)
{
chrome.tabs.create({"url": url.replace("<Q>", encodeURIComponent(query))}, function(tab) {});
}
chrome.contextMenus.create({
id: 'google',
title: (' Искать в Google'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'google') {
chrome.tabs.create({
url: "https://www.google.com/searchbyimage?ie=utf-8&hl=ru&image_url=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'yandex',
title: (' Искать в Yandex'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'yandex') {
chrome.tabs.create({
url: "https://yandex.ru/images/search?rpt=imageview&img_url=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'tineye',
title: (' Искать в Tineye'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'tineye') {
chrome.tabs.create({
url: "https://www.tineye.com/search?url=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'bing',
title: (' Искать в Bing'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'bing') {
chrome.tabs.create({
url: "https://www.bing.com/images/searchbyimage?cbir=sbi&iss=sbi&imgurl=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'Sogou',
title: (' Искать в Sogou'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'Sogou')
{launch("https://pic.sogou.com/ris?query=<Q>&flag=1&drag=0", info.srcUrl)}
});
chrome.contextMenus.create({
id: 'shitu',
title: (' Искать в 360 ShiTu'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'shitu') {
chrome.tabs.create({
url: "http://st.so.com/stu?imgurl=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'saucenao',
title: (' Искать в SauceNAO'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'saucenao') {
chrome.tabs.create({
url: "https://saucenao.com/search.php?db=999&url=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'whatanime',
title: (' Искать аниме в WhatAnime.ga'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'whatanime') {
chrome.tabs.create({
url: "https://whatanime.ga/?url=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'IQdb',
title: (' Мультипоиск c IQdb.com'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'IQdb') {
chrome.tabs.create({
url: "https://iqdb.org/?service[]=0&service[]=1&service[]=2&service[]=3&service[]=4&service[]=5&service[]=6&service[]=10&url=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: '3DIQDB',
title: (' Косплей модели, идолы 3DIQdb'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === '3DIQDB') {
chrome.tabs.create({
url: "https://3d.iqdb.org/?url=" + info.srcUrl
});
}
});
chrome.contextMenus.create({id:'0100',type:('separator'),title:('-'),contexts:['image']});
chrome.contextMenus.create({
id: 'Metapicz',
title: (' Метаданные из картинки'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'Metapicz') {
chrome.tabs.create({
url: "http://metapicz.com/#landing?imgsrc=" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'ImgOps',
title: (' Отправить в ImgOps'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'ImgOps') {
chrome.tabs.create({
url: "https://imgops.com/" + info.srcUrl
});
}
});
chrome.contextMenus.create({
id: 'Ascii2D',
title: (' Отправить в Ascii2D'),
contexts: ['image']
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'Ascii2D') {
chrome.tabs.create({
url: "https://ascii2d.net/search/url/" + info.srcUrl
});
}
});
chrome.contextMenus.create({id:'0102',type:('separator'),title:('-'),contexts:['image']});