How to communicate with popover ?

Hi All,


I am able to send data to content script using page.dispatchMessageToScript() and receive from contnet script using safari.extension.dispatchMessage().

But these methods do not work with popover ui, could not find any example for this communication.


Would appreciate any help.


My Xcode version : Version 10.2 beta 4 (10P107d)


Thanks,

Purusothaman A

Replies

Adding more info for clarity.


I wanted to reuse popover ui html, css and js implemented for chrome extension, so added webview in view controller which gets displayed as popover when toolbar is clicked.

Now i want to know how to send and receive data with popover using javascript.


Is it even possible ?

or we are expected to use only native UI in popover ?

Basically all types of event listners are not working in popover ui.


Any thoughts on why ?

I solved this issue using WKWebView by assigning view frame to web view frame.


//This line of code made the trick to show html in popover ui.

webview.frame = view.frame;