safari-app-extension

Safari App Extension , How to load local html page from extension?

点点圈 提交于 2020-03-05 04:09:04
问题 I have an HTML file in Safari App Extension bundle I want to load this file in this method. override func page(_ page: SFSafariPage, willNavigateTo url: URL?) {} 回答1: Please use this code override func page(_ page: SFSafariPage, willNavigateTo url: URL?) { if (url?.absoluteString.hasPrefix("safari-extension://") ?? true) { return } DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1000)) { page.getContainingTab { tab in SFSafariExtension.getBaseURI { baseURI in guard let baseURI

safari app extension crashes after a few seconds for hello world project

寵の児 提交于 2020-02-20 04:48:51
问题 open xcode file > new >project > Cocoa app file > new > target > safari extension compile and run extension select safari. xcode compiles with no errors. Safari opens for a few seconds then crashes. this is the output of the debug window. 2018-10-10 15:27:18.039905-0700 Safari[1020:16719] [SQLiteStore] Failed to acquire database store coordination lock at /Users//Library/Safari/Favicon Cache/favicons.db-lock: [35: Resource temporarily unavailable] 2018-10-10 15:27:18.040155-0700 Safari[1020

safari app extension crashes after a few seconds for hello world project

坚强是说给别人听的谎言 提交于 2020-02-20 04:42:33
问题 open xcode file > new >project > Cocoa app file > new > target > safari extension compile and run extension select safari. xcode compiles with no errors. Safari opens for a few seconds then crashes. this is the output of the debug window. 2018-10-10 15:27:18.039905-0700 Safari[1020:16719] [SQLiteStore] Failed to acquire database store coordination lock at /Users//Library/Safari/Favicon Cache/favicons.db-lock: [35: Resource temporarily unavailable] 2018-10-10 15:27:18.040155-0700 Safari[1020

How can I close a Safari App Extension popover programmatically?

亡梦爱人 提交于 2019-12-04 10:29:46
问题 I'm building a Safari App Extension using XCode 8.3 and Swift 3, following the Safari App Extension Programming Guide. The extension includes a popover that appears when the extension's toolbar item is clicked. The popover view contains a few buttons linked to actions the user can perform. I want clicking one of these buttons to close the popover after its action has been performed. By default, clicking anywhere outside of a popover closes it, but I haven't been able to find any other way to

How can I close a Safari App Extension popover programmatically?

岁酱吖の 提交于 2019-12-03 06:02:12
I'm building a Safari App Extension using XCode 8.3 and Swift 3, following the Safari App Extension Programming Guide . The extension includes a popover that appears when the extension's toolbar item is clicked. The popover view contains a few buttons linked to actions the user can perform. I want clicking one of these buttons to close the popover after its action has been performed. By default, clicking anywhere outside of a popover closes it, but I haven't been able to find any other way to close the popover, either in the guide or in the docs . I know that NSPopover has a performClose