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 localStorage exceptions to duckduckgo.com #5338

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

aitorvs
Copy link
Collaborator

@aitorvs aitorvs commented Dec 2, 2024

Task/Issue URL: https://app.asana.com/0/1198194956794324/1208875163490368/f

Description

Steps to test this PR

Test
requirement for all tests: IP address needs to be in the US (use DDG production app or another VPN like Nord)

  • fresh install from this branch
  • go through onboarding (sigh)
  • open duckduckgo.com
  • verify a PPro promotion banner appears (Get Privacy Pro!...)
  • tap on fire button
  • open duckduckgo.com
  • verify a PPro promotion banner appears (Get Privacy Pro!...)
  • dismiss the banner (press X)
  • open duckduckgo.com in a new tab
  • verify a PPro promotion banner does NOT appear
  • tap on fire button
  • open duckduckgo.com
  • verify a PPro promotion banner does NOT appear

Copy link
Collaborator Author

aitorvs commented Dec 2, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@aitorvs aitorvs force-pushed the feature/aitor/webview/localStorage branch from 333721e to f6bc3a8 Compare December 2, 2024 21:54
@aitorvs aitorvs force-pushed the feature/aitor/webview/localStorage branch from f6bc3a8 to 38af31a Compare December 3, 2024 07:36
@aitorvs aitorvs marked this pull request as ready for review December 3, 2024 14:59
cmonfortep
cmonfortep previously approved these changes Dec 4, 2024
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just a note, do you think this could impact the fire button process perf depending on the local storage size? unsure how those webview methods perform depending on size. I don't want to slow you down here, but should we consider adding a kill switch in case we detect an increase on feedback around that?

Testing: I don't have vpn, so I've tested this by changing the excluded domain to ".amazon.com" (instead of .duckduckgo.com) and inspecting the local storage via dev tools. After using fire button, local storage was preserved, so it works.

Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm taking another look here and there's something I'm missing.

I've been visiting a bunch of sites to see how those webview methods behave, and getOrigins only returns me 1 origin...but from devtools I see all sites stored something inside their localStorage.

The other thing during testing, I've detected a crash in (origin as Origin).origin cast, which was not visible since we do runcatching. java.lang.ClassCastException: java.util.HashMap$Node cannot be cast to android.webkit.WebStorage$Origin

Let's pair on this tomorrow to close those open questions.

@cmonfortep cmonfortep self-requested a review December 4, 2024 21:47
@cmonfortep cmonfortep dismissed their stale review December 4, 2024 21:48

Review the testing scenario

Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The crash when casting is fixed, and we also clear all data if there's any exception there.
As mentioned, I'm not sure how effective the webview api methods are, but since we have a killswitch that if enabled removes all content, 👍

@aitorvs aitorvs force-pushed the feature/aitor/webview/localStorage branch from 08cd9a8 to 9562bfd Compare December 12, 2024 13:19
@joshliebe joshliebe mentioned this pull request Dec 18, 2024
8 tasks
@joshliebe joshliebe force-pushed the feature/aitor/webview/localStorage branch from 9562bfd to af0cf12 Compare December 18, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants