Skip to content
Open
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, Zen, Dia
case Safari, SafariTechnologyPreview, Chrome, Chromium, Brave, BraveBeta, BraveNightly, Edge, Vivaldi, Arc, Opera, Firefox, FirefoxNightly, FirefoxDeveloperEdition, Zen, Dia, Helium

var bundleIdentifier: String {
return browser.rawValue
Expand Down Expand Up @@ -138,6 +138,8 @@ enum BrowserThatCanWatchBrowserAddressFocus: CaseIterable {
return .Zen
case .Dia:
return .Dia
case .Helium:
return .Helium
}
}

Expand All @@ -159,7 +161,7 @@ enum BrowserThatCanWatchBrowserAddressFocus: CaseIterable {
case .Opera:
return focusedElement.domClassList().contains("AddressTextfieldView")

case .Chromium, .Chrome, .Brave, .BraveBeta, .BraveNightly, .Edge, .Dia:
case .Chromium, .Chrome, .Brave, .BraveBeta, .BraveNightly, .Edge, .Dia, .Helium:
if focusedElement.domClassList().contains("OmniboxViewViews") {
if let description = focusedElement.safeString(attribute: .description),
chromiumSearchBarDescMap[description] == true
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 @@ -129,6 +129,8 @@ extension PreferencesVM {
return preferences.isEnableURLSwitchForZen
case .Dia:
return preferences.isEnableURLSwitchForDia
case .Helium:
return preferences.isEnableURLSwitchForHelium
}
}

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 @@ -232,6 +232,8 @@ extension PreferencesVM {
guard preferences.isEnableURLSwitchForZen else { return nil }
case .Dia:
guard preferences.isEnableURLSwitchForDia else { return nil }
case .Helium:
guard preferences.isEnableURLSwitchForHelium else { return nil }
}

if let application = application,
Expand Down Expand Up @@ -302,6 +304,7 @@ struct Preferences {
static let isEnableURLSwitchForFirefoxNightly = "isEnableURLSwitchForFirefoxNightly"
static let isEnableURLSwitchForZen = "isEnableURLSwitchForZen"
static let isEnableURLSwitchForDia = "isEnableURLSwitchForDia"
static let isEnableURLSwitchForHelium = "isEnableURLSwitchForHelium"

static let shortcutTriggerMode = "shortcutTriggerMode"
static let singleModifierTrigger = "singleModifierTrigger"
Expand Down Expand Up @@ -493,6 +496,9 @@ struct Preferences {
@UserDefault(Preferences.Key.isEnableURLSwitchForDia)
var isEnableURLSwitchForDia = false

@UserDefault(Preferences.Key.isEnableURLSwitchForHelium)
var isEnableURLSwitchForHelium = false

// MARK: - Appearance

@available(*, deprecated, message: "Use indicatorInfo instead")
Expand Down
3 changes: 3 additions & 0 deletions Input Source Pro/Persistence/SettingsBackup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ struct SettingsBackupPreferences: Codable {
var isEnableURLSwitchForFirefoxNightly: Bool?
var isEnableURLSwitchForZen: Bool?
var isEnableURLSwitchForDia: Bool?
var isEnableURLSwitchForHelium: Bool?
var indicatorInfo: IndicatorInfo?
var indicatorSize: IndicatorSize?
var isAutoAppearanceMode: Bool?
Expand Down Expand Up @@ -193,6 +194,7 @@ struct SettingsBackupPreferences: Codable {
isEnableURLSwitchForFirefoxNightly = preferences.isEnableURLSwitchForFirefoxNightly
isEnableURLSwitchForZen = preferences.isEnableURLSwitchForZen
isEnableURLSwitchForDia = preferences.isEnableURLSwitchForDia
isEnableURLSwitchForHelium = preferences.isEnableURLSwitchForHelium
indicatorInfo = preferences.indicatorInfo
indicatorSize = preferences.indicatorSize
isAutoAppearanceMode = preferences.isAutoAppearanceMode
Expand Down Expand Up @@ -279,6 +281,7 @@ struct SettingsBackupPreferences: Codable {
}
if let isEnableURLSwitchForZen { preferences.isEnableURLSwitchForZen = isEnableURLSwitchForZen }
if let isEnableURLSwitchForDia { preferences.isEnableURLSwitchForDia = isEnableURLSwitchForDia }
if let isEnableURLSwitchForHelium { preferences.isEnableURLSwitchForHelium = isEnableURLSwitchForHelium }
if let indicatorInfo { preferences.indicatorInfo = indicatorInfo }
if let indicatorSize { preferences.indicatorSize = indicatorSize }
if let isAutoAppearanceMode { preferences.isAutoAppearanceMode = isAutoAppearanceMode }
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 @@ -183,6 +183,8 @@ struct BrowserRulesSettingsView: View {
$0.isEnableURLSwitchForZen = isEnable
case .Dia:
$0.isEnableURLSwitchForDia = isEnable
case .Helium:
$0.isEnableURLSwitchForHelium = 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 @@ -20,6 +20,7 @@ enum Browser: String, CaseIterable {
case FirefoxNightly = "org.mozilla.nightly"
case Zen = "app.zen-browser.zen"
case Dia = "company.thebrowser.dia"
case Helium = "net.imput.helium"

var displayName: String {
switch self {
Expand Down Expand Up @@ -57,6 +58,8 @@ enum Browser: String, CaseIterable {
return "Zen"
case .Dia:
return "Dia"
case .Helium:
return "Helium"
}
}
}
Expand Down