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

New C-S-S webcompat intervention: modifyLocalStorage #1026

Merged
merged 16 commits into from
Sep 25, 2024

Conversation

dharb
Copy link
Contributor

@dharb dharb commented Sep 8, 2024

Adds new webcompat intervention to modify localStorage entries on specified domains. At the moment delete is the only action implemented, but extensibility is there to add other actions (create, update) if necessary in the future. This feature is only enabled on iOS & Android.

Asana Task/Github Issue: https://app.asana.com/0/246491496396031/1207836782368191/f
Corresponding privacy config changes: duckduckgo/privacy-configuration#2283

Testing steps:
There are a couple ways to test this:
Option A (easiest): Run the integration tests included in this PR to check against the privacy test page also included in this PR

  1. Checkout this branch, run npm i then run npm run test-int. This will use puppeteer to check that the tests here succeed.

Option B:

  1. Clone https://github.com/duckduckgo/privacy-test-pages and in package.json, point https://github.com/duckduckgo/privacy-test-pages/blob/main/package.json#L24 at this branch and npm i
  2. Start the privacy test page local server by running npm run start from that directory
  3. Create an iOS or Android dev build pointing C-S-S at this branch and privacy configuration at New C-S-S webcompat intervention: modifyLocalStorage privacy-configuration#2283 and run it on the simulator
  4. From the simulator, navigate to localhost:3000/content-scope-scripts/webcompat/pages/modify-localstorage.html and see that tests are green
  5. Alternatively, from the simulator, navigate to any old MSN article page and refresh the page two or more times. See that the Expand Article button persists across reloads.

Copy link

netlify bot commented Sep 8, 2024

Deploy Preview for release-notes-preview canceled.

Name Link
🔨 Latest commit fe5da2e
🔍 Latest deploy log https://app.netlify.com/sites/release-notes-preview/deploys/66ddad38f8def3000884303d

@dharb dharb changed the title New C-S-S webcompat intervention: modifyLocalStorage (WIP) New C-S-S webcompat intervention: modifyLocalStorage Sep 8, 2024
Copy link

github-actions bot commented Sep 8, 2024

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Sep 8, 2024

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Sep 8, 2024

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@dharb
Copy link
Contributor Author

dharb commented Sep 19, 2024

@jonathanKingston I got the privacy test page up and running and integration tests are passing locally, but something else seems to be going awry in CI - seeing a lot of Test timeout of 30000ms exceeded., not sure what's causing it.

Also made the changes we discussed to have /content-scope-scripts/webcompat/ be a directory of webcompat test pages. Want to give this a review when you get a chance?

package.json Outdated Show resolved Hide resolved
Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@dharb dharb changed the title (WIP) New C-S-S webcompat intervention: modifyLocalStorage New C-S-S webcompat intervention: modifyLocalStorage Sep 19, 2024
Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

package-lock.json Outdated Show resolved Hide resolved
Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@dharb
Copy link
Contributor Author

dharb commented Sep 25, 2024

Ready for final review / merge. I'll get the other PRs together

@jonathanKingston jonathanKingston merged commit f70c970 into main Sep 25, 2024
6 checks passed
@jonathanKingston jonathanKingston deleted the dharb/modify-localstorage branch September 25, 2024 19:56
dharb added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Sep 25, 2024
<!--
Note: This checklist is a reminder of our shared engineering
expectations.
-->

Please review the release process for BrowserServicesKit
[here](https://app.asana.com/0/1200194497630846/1200837094583426).

**Required**:

Task/Issue URL:
https://app.asana.com/0/72649045549333/1207836782368194/f
iOS PR: duckduckgo/iOS#3396
macOS PR: duckduckgo/macos-browser#3347
What kind of version bump will this require?: Minor

**Optional**:

Tech Design URL:
https://app.asana.com/0/72649045549333/1207836782368196/f
CC: @jonathanKingston 

**Description**:
This PR bumps the C-S-S pin to pull in the changes from
duckduckgo/content-scope-scripts#1026.

<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be
marked with the `DO NOT MERGE` label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the `Pending Product
Review` label.

If at any point it isn't actively being worked on/ready for
review/otherwise moving forward (besides the above PR/PFR exception)
strongly consider closing it (or not opening it in the first place). If
you decide not to close it, make sure it's labelled to make it clear the
PRs state and comment with more information.
-->

**Steps to test this PR**:
1. Navigate to any old [MSN article
page](https://www.msn.com/en-us/sports/nfl/how-saquon-barkley-gave-eagles-coach-a-hard-lesson-in-accountability-while-saving-season/ar-AA1qPl89?ocid=hpmsn&cvid=81d6bc9eb97e442ba7de62c248189b23&ei=12)
and refresh the page two or more times. See that the `Expand Article`
button persists across reloads.

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**OS Testing**:

* [ ] iOS 14
* [ ] iOS 15
* [ ] iOS 16
* [ ] macOS 10.15
* [ ] macOS 11
* [ ] macOS 12

---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
dharb added a commit to duckduckgo/iOS that referenced this pull request Sep 26, 2024
<!--
Note: This checklist is a reminder of our shared engineering
expectations. Feel free to change it, although assigning a GitHub
reviewer and the items in bold are required.

⚠️ If you're an external contributor, please file an issue first before
working on a PR, as we can't guarantee that we will accept your changes
if they haven't been discussed ahead of time. Thanks!
-->

Task/Issue URL:
https://app.asana.com/0/72649045549333/1207836782368194/f
Tech Design URL:
https://app.asana.com/0/72649045549333/1207836782368196/f
Corresponding BSK PR:
duckduckgo/BrowserServicesKit#1006
Corresponding macOS PR:
duckduckgo/macos-browser#3347

CC: @jonathanKingston 

**Description**:
This PR bumps the BSK pin to pull in the changes from
duckduckgo/content-scope-scripts#1026.

<!--
If at any point it isn't actively being worked on/ready for
review/otherwise moving forward strongly consider closing it (or not
opening it in the first place). If you decide not to close it, use Draft
PR while work is still in progress or use `DO NOT MERGE` label to
clarify the PRs state and comment with more information.
-->

**Steps to test this PR**:
1. Navigate to any old [MSN article
page](https://www.msn.com/en-us/sports/nfl/how-saquon-barkley-gave-eagles-coach-a-hard-lesson-in-accountability-while-saving-season/ar-AA1qPl89?ocid=hpmsn&cvid=81d6bc9eb97e442ba7de62c248189b23&ei=12)
and refresh the page two or more times. See that the Expand Article
button persists across reloads.

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**Definition of Done (Internal Only)**:

* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

**Copy Testing**:

* [ ] Use of correct apostrophes in new copy, ie `’` rather than `'`

**Orientation Testing**:

* [ ] Portrait
* [ ] Landscape

**Device Testing**:

* [ ] iPhone SE (1st Gen)
* [ ] iPhone 8
* [ ] iPhone X
* [ ] iPhone 14 Pro
* [ ] iPad

**OS Testing**:

* [ ] iOS 15
* [ ] iOS 16
* [ ] iOS 17

**Theme Testing**:

* [ ] Light theme
* [ ] Dark theme

---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
dharb added a commit to duckduckgo/macos-browser that referenced this pull request Sep 26, 2024
Task/Issue URL:
https://app.asana.com/0/72649045549333/1207836782368194/f
Tech Design URL:
https://app.asana.com/0/72649045549333/1207836782368196/f
Corresponding BSK PR:
duckduckgo/BrowserServicesKit#1006
Corresponding iOS PR: duckduckgo/iOS#3396
CC:

**Description**:
This PR bumps the BSK pin to pull in the changes from
duckduckgo/content-scope-scripts#1026. This
feature is not active on desktop platforms, so no changes to be tested
from this PR.


<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be
marked with the `DO NOT MERGE` label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the `Pending Product
Review` label.

If at any point it isn't actively being worked on/ready for
review/otherwise moving forward (besides the above PR/PFR exception)
strongly consider closing it (or not opening it in the first place). If
you decide not to close it, make sure it's labelled to make it clear the
PRs state and comment with more information.
-->

**Definition of Done**:

* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

---
###### Internal references:
[Pull Request Review
Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f)
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
[Pull Request
Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)
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.

3 participants