Add a browser setting to Firefox Lockbox
These instructions are for developers wanting to add another browser setting so when users tap to open an entry's URL it will be sent to the web browser of their choice.
- Find and add the query scheme the new browser has registered to
Common/Resources/Info.plist. For example we'll use DuckDuckGo:
- Then add a new case to
- Define that new case in the
getPreferredBrowserDeeplinkswitch statement and return the string with that new query scheme as the expected URL syntax. Keep in mind you may need to encode the URLs and test some links to make sure they open as expected on a real device with the browser installed:
return URL(string: "ddgQuickLink://\(url)")
- Add a constant (string) for the name of the browser (this will be used for the setting) to
static let settingsBrowserDuckDuckGo = NSLocalizedString("settings.browser.duckduckgo", value: "Duck Duck Go", comment: "Duck Duck Go Browser")
- Then include the constant (name of the browser) to the case in the
toString()function back in
- Also add the name constant to the
PreferredBrowserSettingPresenterclass can mark the browser as "checked" when selected:
lazy var initialSettings = [
If you'd like to contribute a patch with the above, or anything else, please read our contributing guidelines.