mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Make adding context menus redundent and fix enable/disable bug
This commit is contained in:
parent
5c1941d142
commit
091141f2cf
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
const timeouted = window.utils.timeouted;
|
const chromified = window.utils.chromified;
|
||||||
|
|
||||||
let seqId = 0;
|
let seqId = 0;
|
||||||
|
|
||||||
|
@ -10,21 +10,17 @@
|
||||||
|
|
||||||
const id = (++seqId).toString();
|
const id = (++seqId).toString();
|
||||||
|
|
||||||
chrome.runtime.onInstalled.addListener(
|
chrome.contextMenus.create({
|
||||||
() => chrome.contextMenus.create({
|
id: id,
|
||||||
id: id,
|
title: title,
|
||||||
title: title,
|
contexts: ['browser_action'],
|
||||||
contexts: ['browser_action'],
|
}, chromified((err) => {
|
||||||
}, timeouted(() => {
|
|
||||||
|
|
||||||
const err = chrome.runtime.lastError;
|
if(err) {
|
||||||
if(err) {
|
console.warn('Context menu error ignored:', err);
|
||||||
console.warn('Context menu error:', err);
|
}
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
|
|
||||||
}))
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
chrome.contextMenus.onClicked.addListener((info, tab) => {
|
chrome.contextMenus.onClicked.addListener((info, tab) => {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user