Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Input Source Pro/Models/PreferencesVM+BrowserAddress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -134,6 +134,8 @@ enum BrowserThatCanWatchBrowserAddressFocus: CaseIterable {
return .FirefoxNightly
case .FirefoxDeveloperEdition:
return .FirefoxDeveloperEdition
case .Zen:
return .Zen
}
}

Expand Down Expand Up @@ -174,7 +176,7 @@ enum BrowserThatCanWatchBrowserAddressFocus: CaseIterable {
return false
}

case .Firefox, .FirefoxNightly, .FirefoxDeveloperEdition:
case .Firefox, .FirefoxNightly, .FirefoxDeveloperEdition, .Zen:
return focusedElement.firefoxDomIdentifier() == "urlbar-input"
}
}
Expand Down
2 changes: 2 additions & 0 deletions Input Source Pro/Models/PreferencesVM+BrowserRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ extension PreferencesVM {
return preferences.isEnableURLSwitchForFirefoxDeveloperEdition
case .FirefoxNightly:
return preferences.isEnableURLSwitchForFirefoxNightly
case .Zen:
return preferences.isEnableURLSwitchForZen
}
}

Expand Down
6 changes: 6 additions & 0 deletions Input Source Pro/Models/PreferencesVM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions Input Source Pro/UI/Screens/BrowserRulesSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ struct BrowserRulesSettingsView: View {
$0.isEnableURLSwitchForFirefoxDeveloperEdition = isEnable
case .FirefoxNightly:
$0.isEnableURLSwitchForFirefoxNightly = isEnable
case .Zen:
$0.isEnableURLSwitchForZen = isEnable
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Input Source Pro/Utilities/BrowserURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -51,6 +52,8 @@ enum Browser: String, CaseIterable {
return "Firefox Developer Edition"
case .FirefoxNightly:
return "Firefox Nightly"
case .Zen:
return "Zen"
}
}
}
Expand Down