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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

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?

@@ -70,7 +70,7 @@
"@types/chrome": "^0.0.248",
"@types/jasmine": "^5.1.4",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"config-builder": "github:duckduckgo/privacy-configuration#main",
"config-builder": "github:duckduckgo/privacy-configuration#dharb/modify-localstorage-config",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll flip this back once the config PR is merged.

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

<script>
// eslint-disable-next-line no-undef
test('Only specified localStorage entry should be removed', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a test for a key that is also isn't present but the code deletes?

Copy link
Contributor Author

@dharb dharb Sep 19, 2024

Choose a reason for hiding this comment

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

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.

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