Skip to content

Commit

Permalink
fix compile error: variable tab not found
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-jianliang authored May 10, 2024
1 parent 14bebbf commit 2ac952b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/background/menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ export async function createAgentMenus() {

browser.contextMenus?.onClicked.addListener(async function (info: OnClickData) {
const agent = agentsRegistry.getAgent(<string>info.menuItemId);
const [tab] = await chrome.tabs.query({ active: true, lastFocusedWindow: true });

console.log('[background.js', 'contextMenus onClicked', info);
if (info.menuItemId === MENU_ITEM_ID_OPEN_SIDE_PANEL) {
// This will open the panel in all the pages on the current window.
// Only chrome supports this feature.
await chrome.sidePanel.open({ windowId: tab.windowId });
} else {
const [tab] = await chrome.tabs.query({ active: true, lastFocusedWindow: true })
tab.id &&
(await browser.tabs.sendMessage(tab.id, {
type: MESSAGE_TYPE_MENU_CLICKED,
Expand Down

0 comments on commit 2ac952b

Please sign in to comment.