0

I have created a chrome extension with MV3, I configured my manifest to work on private windows

"incognito": "split"

and It is working properly If I allow private mode Allow congnito

It works.

Whenever I open a private window without allowing the extension, I get this error:

Service worker registration failed

enter image description here

Any solution to that to solve this error?

EDIT: I use

chrome.tabs.onUpdated.addListener
chrome.tabs.onActivated.addListener
chrome.windows.onRemoved.addListener
chrome.windows.onFocusChanged.addListener
chrome.tabs.onRemoved.addListener

In my background script when I delete them, error doesn't occur

Ugur Kellecioglu
  • 370
  • 1
  • 3
  • 9
  • It's either a bug in Chrome or a mistake in your code. You can delete half of it and see if the problem is gone, then repeat the process progressively until you have the smallest part that causes the error. – wOxxOm Aug 31 '22 at 17:13
  • Even if I put empty chrome.tabs or chrome.windows It produces this error. It probably can't react them since user didn't allow the private usage. I tried https://stackoverflow.com/a/23527746/13587169 this but didn't work as well. – Ugur Kellecioglu Aug 31 '22 at 17:27
  • A registration error means something outside a listener, so changing the inside won't help, which is why I suggested removing in halves. You also need to reload the extension after editing it. – wOxxOm Aug 31 '22 at 19:00
  • I mean, I deleted all my code in background scriptp then put a chrome tabs onUpdate method which logs a string, It instantly produces the error when I open incognito window . But when I delete all code and just put a console log error doesn't occur – Ugur Kellecioglu Aug 31 '22 at 19:12

0 Answers0