Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hidden renderer for fetching backup search results #43399

Closed
DJAndries opened this issue Jan 21, 2025 · 3 comments · Fixed by brave/brave-core#27285 or brave/brave-core#27368
Closed

Comments

@DJAndries
Copy link
Collaborator

In order to fetch search results from backup providers anonymously, a hidden renderer must be embedded to execute the scripts required to render the results. The renderer will use an off-the-record profile for briefly preserving cookie state, which will be subsequently destroyed shortly after the results have been rendered/fetched.

If a user is opted in to Web Discovery or Brave Search fallback mixing, the hidden renderer will be used to fetch the results anonymously.

@kjozwiak
Copy link
Member

The above requires 1.74.51 or higher for 1.74.x verification 👍

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Jan 29, 2025

Verification PASSED on

Brave | 1.74.51 Chromium: 132.0.6834.160 (Official Build) (64-bit)
-- | --
Revision | ec533795e8d43cd81dd0c0cff9ed1dbf23d930e2
OS | Windows 10 Version 22H2 (Build 19045.5371)

Test Case #1 - Brave Search fallback on Desktop

Using the STR/Cases mentioned via brave/brave-core#27285 (comment), ensured that:

  • ensured that two requests are sent to google.com and the response body of the second request is over 50kb
  • ensured there's no Not many great matches error when searching https://search.brave.software/search?q=javier+likes+google+42
  • ensured opening/closing Brave doesn't crash the browser while https://search.brave.software/search?q=javier+likes+google+42 is opened/active tab.
Example Example Example Example
Image Image Image Image

Test Case #2 - Web Discovery on Desktop

Using the STR/Cases mentioned via brave/brave-core#27285 (comment), ensured that:

  • enabled WDP via brave://settings/search
  • visited brave://inspect and clicked on Inspect via Brave chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/_generated_background_page.html
  • within Dev Tools via the Console, pasted the following and waited ~10s:
WDP.modules['web-discovery-project'].background.webDiscoveryProject.patternsLoader.resourceWatcher.forceUpdate()
WDP.modules['web-discovery-project'].background.webDiscoveryProject.strictQueries.map(x=>x.tDiff=0)
  • waited ~10s and ensured there was two google.com requests logged with the second being over 50kbs
Example Example Example
Image Image Image

@hffvld hffvld added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Jan 29, 2025
@hffvld
Copy link
Contributor

hffvld commented Jan 29, 2025

Verified on Pixel 6 using version(s):

Device/OS: Pixel 6 / oriole-user 15 AP4A.241205.013 release-keys
Brave build: 1.74.51 
Chromium: 132.0.6834.160 (Official Build) (64-bit) 

STEPS:

  1. Follow the STR/TP from Add hidden renderer for fetching backup search results brave-core#27285 (comment)
  2. Verify

ACTUAL RESULTS:

  • Verified that the string is larger than 50kb gets returned.
  • Verified that Brave doesn't crash when loading different websites.

1 2 3 4
1 2 3 4

@hffvld hffvld added QA Pass - Android ARM and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment