Skip to content

Commit

Permalink
Fix error when recreating context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
AjaxGb committed Mar 11, 2024
1 parent ea8bd96 commit 5431f52
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions service_worker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const toggleContextID = "contextToggle";

let lastSendResponse;

const toggleContextID = chrome.contextMenus.create({
type : "checkbox",
id : "contextToggle",
title : chrome.i18n.getMessage("contextToggle"),
contexts: ["video"]
});
chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create({
type : "checkbox",
id : toggleContextID,
title : chrome.i18n.getMessage("contextToggle"),
contexts: ["video"]
});
})

chrome.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId !== toggleContextID) return;
Expand Down

0 comments on commit 5431f52

Please sign in to comment.