diff --git a/Input Source Pro/Models/PreferencesVM+BrowserAddress.swift b/Input Source Pro/Models/PreferencesVM+BrowserAddress.swift index 838603f..94d4fa7 100644 --- a/Input Source Pro/Models/PreferencesVM+BrowserAddress.swift +++ b/Input Source Pro/Models/PreferencesVM+BrowserAddress.swift @@ -98,7 +98,7 @@ enum BrowserThatCanWatchBrowserAddressFocus: CaseIterable { return nil } - case Safari, SafariTechnologyPreview, Chrome, Chromium, Brave, BraveBeta, BraveNightly, Edge, Vivaldi, Arc, Opera, Firefox, FirefoxNightly, FirefoxDeveloperEdition + case Safari, SafariTechnologyPreview, Chrome, Chromium, Brave, BraveBeta, BraveNightly, Edge, Vivaldi, Arc, Opera, Firefox, FirefoxNightly, FirefoxDeveloperEdition, Zen var bundleIdentifier: String { return browser.rawValue @@ -134,6 +134,8 @@ enum BrowserThatCanWatchBrowserAddressFocus: CaseIterable { return .FirefoxNightly case .FirefoxDeveloperEdition: return .FirefoxDeveloperEdition + case .Zen: + return .Zen } } @@ -174,7 +176,7 @@ enum BrowserThatCanWatchBrowserAddressFocus: CaseIterable { return false } - case .Firefox, .FirefoxNightly, .FirefoxDeveloperEdition: + case .Firefox, .FirefoxNightly, .FirefoxDeveloperEdition, .Zen: return focusedElement.firefoxDomIdentifier() == "urlbar-input" } } diff --git a/Input Source Pro/Models/PreferencesVM+BrowserRule.swift b/Input Source Pro/Models/PreferencesVM+BrowserRule.swift index 266d01f..ab2f86a 100644 --- a/Input Source Pro/Models/PreferencesVM+BrowserRule.swift +++ b/Input Source Pro/Models/PreferencesVM+BrowserRule.swift @@ -117,6 +117,8 @@ extension PreferencesVM { return preferences.isEnableURLSwitchForFirefoxDeveloperEdition case .FirefoxNightly: return preferences.isEnableURLSwitchForFirefoxNightly + case .Zen: + return preferences.isEnableURLSwitchForZen } } diff --git a/Input Source Pro/Models/PreferencesVM.swift b/Input Source Pro/Models/PreferencesVM.swift index cbd8d1d..f643b1c 100644 --- a/Input Source Pro/Models/PreferencesVM.swift +++ b/Input Source Pro/Models/PreferencesVM.swift @@ -172,6 +172,8 @@ extension PreferencesVM { guard preferences.isEnableURLSwitchForFirefoxDeveloperEdition else { return nil } case .FirefoxNightly: guard preferences.isEnableURLSwitchForFirefoxNightly else { return nil } + case .Zen: + guard preferences.isEnableURLSwitchForZen else { return nil } } if let application = application, @@ -238,6 +240,7 @@ struct Preferences { static let isEnableURLSwitchForFirefox = "isEnableURLSwitchForFirefox" static let isEnableURLSwitchForFirefoxDeveloperEdition = "isEnableURLSwitchForFirefoxDeveloperEdition" static let isEnableURLSwitchForFirefoxNightly = "isEnableURLSwitchForFirefoxNightly" + static let isEnableURLSwitchForZen = "isEnableURLSwitchForZen" static let isAutoAppearanceMode = "isAutoAppearanceMode" static let appearanceMode = "appearanceMode" @@ -352,6 +355,9 @@ struct Preferences { @UserDefault(Preferences.Key.isEnableURLSwitchForFirefoxNightly) var isEnableURLSwitchForFirefoxNightly = false + @UserDefault(Preferences.Key.isEnableURLSwitchForZen) + var isEnableURLSwitchForZen = false + // MARK: - Appearance @available(*, deprecated, message: "Use indicatorInfo instead") diff --git a/Input Source Pro/UI/Screens/BrowserRulesSettingsView.swift b/Input Source Pro/UI/Screens/BrowserRulesSettingsView.swift index 6a62ed2..e2737c9 100644 --- a/Input Source Pro/UI/Screens/BrowserRulesSettingsView.swift +++ b/Input Source Pro/UI/Screens/BrowserRulesSettingsView.swift @@ -175,6 +175,8 @@ struct BrowserRulesSettingsView: View { $0.isEnableURLSwitchForFirefoxDeveloperEdition = isEnable case .FirefoxNightly: $0.isEnableURLSwitchForFirefoxNightly = isEnable + case .Zen: + $0.isEnableURLSwitchForZen = isEnable } } } diff --git a/Input Source Pro/Utilities/BrowserURL.swift b/Input Source Pro/Utilities/BrowserURL.swift index 2327913..fdd472b 100644 --- a/Input Source Pro/Utilities/BrowserURL.swift +++ b/Input Source Pro/Utilities/BrowserURL.swift @@ -18,6 +18,7 @@ enum Browser: String, CaseIterable { case Firefox = "org.mozilla.firefox" case FirefoxDeveloperEdition = "org.mozilla.firefoxdeveloperedition" case FirefoxNightly = "org.mozilla.nightly" + case Zen = "app.zen-browser.zen" var displayName: String { switch self { @@ -51,6 +52,8 @@ enum Browser: String, CaseIterable { return "Firefox Developer Edition" case .FirefoxNightly: return "Firefox Nightly" + case .Zen: + return "Zen" } } }