This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.

20 lines
636 B
JavaScript
Raw Normal View History

chrome.storage.sync.get(['choise','simple'], function(items) {
var choise=items['choise'];
if(choise == undefined) choise = true;
if(choise) chrome.browserAction.setBadgeText({text: "on"});
else chrome.browserAction.setBadgeText({text: "off"});
});
chrome.contextMenus.create({"title": "Показать ответы","onclick" : show});
function show(info) {
var url = info.pageUrl;
var url_ = "www.cambridgelms.org";
if(JSON.stringify(url).includes(url_))
{
var query = { active: true, currentWindow: true };
chrome.tabs.query(query, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, {command: "show"});
});
}
}