In theory...
override func messageReceived(withName messageName: String, from page: SFSafariPage, userInfo: [String : Any]?) {
// This method will be called when a content script provided by your extension calls safari.extension.dispatchMessage("message").
page.getContainingTab { (tab) in
tab.getContainingWindow(completionHandler: { (window) in
window?.getToolbarItem(completionHandler: { (toolbaritem) in
toolbaritem?.showPopover()
})
})
}
}
But I did never have any success with this method showPopover.
Either using Command or Popover setting in Info.plist for the Action.
The showPopover message does nothing...
If you have any success with this... I'd be pleased to know.