Create a JS API for a search provider to ask permission to set itself as the default provider #16270
Labels
feature/search
OS/Android
Fixes related to Android browser functionality
OS/Desktop
QA Pass - Android ARM
QA Pass-Linux
QA Pass-macOS
QA Pass-Win64
QA/Test-All-Platforms
QA/Yes
release-notes/exclude
Milestone
Test plan
Not on search.brave.com (negative test)
window.brave.getCanSetDefaultSearchProvider
and hit enterUncaught TypeError: Cannot read property 'getCanSetDefaultSearchProvider' of undefined
window.brave.setIsDefaultSearchProvider
and hit enterOn search.brave.com
Dev tools test
window.brave.getCanSetDefaultSearchProvider
and hit enterwindow.brave.setIsDefaultSearchProvider
and hit enterReal test
courtesy of @kjozwiak
Brave Browser
Brave Search beta
set as the defaultDescription
The API should be limited to a specific set of URLs.
The API should contain 2 methods:
window.brave.getCanSetDefaultSearchProvider()
:--> Returns
Promise<bool>
:false
if current site is the default provider or has asked > X times in current day or > Y times in total, or is in private / TOR context. Returnstrue
otherwise.window.brave.setIsDefaultSearchProvider()
:--> Returns
void
: Sets current site to be the default provider. Must be done inside user gesture. Internally checks same logic asgetCanSetDefaultSearchProvider
.The API should be able to be disabled via feature flag / griffin.
The text was updated successfully, but these errors were encountered: