brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.53k stars 2.27k forks source link

OpenSearch overrides custom search engine parameters #18192 #37059

Open Germs2004 opened 2 years ago

Germs2004 commented 2 years ago

Description

I installed the iOS app and am trying to add a customized version of StartPage as the default search engine. StartPage allows an optional URL parameter called "prfe" which allows users to specify certain preferences without requiring a cookie. For example, you can specify to open results in the same tab or in a popup tab when clicked. When I add my StartPage URL with the custom preferences, the iOS app apparently detects that I'm using a "startpage.com" URL and it overrides my custom URL with a generic one. I need to be able to tell the iOS app to use my custom URL (and title) instead of the one it suggests.

The URL I'm trying to add: https://www.startpage.com/do/dsearch?q=%s&prfe=1ace035be5f7cd9e9818fa0ea57781842c6974a9d9272f75d5f7bda0c2ff973a2f6d809398d6488f9f8ecf27b559a3642ea139ab3d4c8474ad5631adde0cc7ff2c6b6e117e61d3593788485faa98a6

Steps to Reproduce

  1. Install Brave on iOS
  2. Go to Settings > Search Engines > New Custom Search Engine
  3. In URL, paste the URL I mentioned above.
  4. In TITLE, write "StartPage Custom"
  5. Press Add

Actual result:

A popup appears titled "Add Search Provider?" The URL shown in that popup is nothing like the URL I entered, and the title is also changed to just "StartPage." The URL it suggests includes the phrase "opensearch" so I assume the iOS app is trying to be smart by looking up the "correct" URL for StartPage. If I click Cancel, it fails to add my custom URL. If I click OK, it adds the engine using the generic URL. Neither option allows me to add the engine with my custom URL.

Expected result:

The popup should say "Do you want to use the recommended URL for StartPage?" and it should display the recommended URL. Then, it should have 3 buttons: "Use Recommended URL", "Use Your Specified URL", "Cancel".

Reproduces how often:

Every time

Brave version (info found on brave://version)

iOS app - Brave - 1.31 (23)

Germs2004 commented 2 years ago

I found a workaround:

Turn off cellular and Wi-Fi, then add your custom StartPage URL. That prevents the Brave app from overriding your custom URL since it can't look up the "correct" version. When you turn cellular and Wi-Fi back on afterward, your custom search URL remains unharmed and works as intended.