0

I have a case where I want to track down the click on action item under sidepanel The below code

chrome.sidePanel
  .setPanelBehavior({ openPanelOnActionClick: true }).addListener(callback)

throws error

Uncaught TypeError: chrome.sidePanel.setPanelBehavior(...).addListener is not a function

How can I track the callback for the case where a user comes in and click on the action button and sidepanel extension opens up which will then in background fetch specific elements from the current tab webpage (which I have already wrote down) and then display those elements content on the sidepanel UI This needs to be done on every tab change

Matey Johnson
  • 223
  • 1
  • 2
  • 12
  • setPanelBehavior returns a void Promise, so you can't use addListener on it. Generally you can simply use chrome.tabs.onUpdated and chrome.tabs.onActivated in your sidePanel js script, not in the background script (service worker). – wOxxOm Aug 29 '23 at 08:16

0 Answers0