fix: url scheme no working before launch

This commit is contained in:
yicheng 2021-10-04 12:26:33 +08:00
parent 4bd711be16
commit 32b8569c7e
No known key found for this signature in database
GPG Key ID: 7CF411A6623B1C0A

View File

@ -62,7 +62,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
signal(SIGPIPE, SIG_IGN)
// crash recorder
failLaunchProtect()
registCrashLogger()
NSAppleEventManager.shared()
.setEventHandler(self,
andSelector: #selector(handleURL(event:reply:)),
forEventClass: AEEventClass(kInternetEventClass),
andEventID: AEEventID(kAEGetURL))
}
func applicationDidFinishLaunching(_ notification: Notification) {
@ -75,6 +79,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
statusItemView = StatusItemView.create(statusItem: statusItem)
statusItemView.frame = CGRect(x: 0, y: 0, width: statusItemLengthWithSpeed, height: 22)
statusMenu.delegate = self
registCrashLogger()
startAnrDetect()
DispatchQueue.main.async {
self.postFinishLaunching()
@ -118,11 +123,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
RemoteConfigManager.shared.autoUpdateCheck()
NSAppleEventManager.shared()
.setEventHandler(self,
andSelector: #selector(handleURL(event:reply:)),
forEventClass: AEEventClass(kInternetEventClass),
andEventID: AEEventID(kAEGetURL))
setupNetworkNotifier()
}