1 Reply
      Latest reply on Oct 19, 2019 1:06 PM by digitalturbulence
      Mamusasium Level 1 Level 1 (0 points)

        Hi,

         

        does anybody know if there is a way to show a NSAlert when the "messageReceived" event is called?

         

        If I create an alert in the event I get this message: "warning: unable to obtain service marshal for app-modal session"

        • Re: Alert
          digitalturbulence Level 1 Level 1 (0 points)

          For some unknown reasons, the whole AppKit engine works only once the Popover has been opened (probably there are some internal initializations).

           

          You can trigger it by doing this:

          SFSafariApplication.getActiveWindow { (window) in
            window?.getToolbarItem(completionHandler: { (item) in
            item?.showPopover()
            })
            }

          Then put your code inside:

          overridefunc viewDidAppear() {
          // Do here your AppKit code
            }

          For some reasons, its not possible to use modals in Safari Extensions. Don't know why.

          The ability to use AppKit widgets is very limited. I use NSPanels.