Search code examples
safari-extensionpopover

How to debug safari extension popover?


How to open javascript console for extension popover in safari?

Thanks.


Solution

  • Unfortunately, it looks like Apple forgot to provide a way to open a console for a popover.

    To somewhat facilitate debugging a popover, you can use the console.log() method of the extension's global page from a script in the popover:

      safari.extension.globalPage.contentWindow.console.log()
    

    This will write to the global page's console.