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 test covering insecure context #1264

Merged
merged 1 commit into from
Nov 25, 2024
Merged

add test covering insecure context #1264

merged 1 commit into from
Nov 25, 2024

Conversation

shakyShane
Copy link
Contributor

@shakyShane shakyShane commented Nov 24, 2024

Asana Task/Github Issue: https://app.asana.com/0/1201614831475344/1208833232752657/f

Description

  • added high level test for the navigatorInterface in an insecure context
  • the test serves as a sanity check that nothing is globally broken too

Testing Steps

Testing this is all about ensuring the test can FAIL when there's a problem, so:

  • Apply the patch below locally, to simulate a recent bug
  • then, inside injected, run npm run test-int -- navigator-interface-insecure.js
    • note: this command will build the assets too, so no need to worry about getting the correct build 💪🏻
  • you should see a test failure - when inspecting the page it's clear the bug was caused by the change to globals.

patch to apply

Index: injected/src/captured-globals.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/injected/src/captured-globals.js b/injected/src/captured-globals.js
--- a/injected/src/captured-globals.js	(revision 64fa3a00615e0a63936236983a4f4ac468b578d6)
+++ b/injected/src/captured-globals.js	(date 1732484599046)
@@ -23,4 +23,4 @@
 export const String = globalThis.String;
 export const Map = globalThis.Map;
 export const Error = globalThis.Error;
-export const randomUUID = globalThis.crypto?.randomUUID?.bind(globalThis.crypto);
+export const randomUUID = globalThis.crypto?.randomUUID.bind(globalThis.crypto);

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

@shakyShane
Copy link
Contributor Author

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

Copy link

netlify bot commented Nov 24, 2024

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 64fa3a0
🔍 Latest deploy log https://app.netlify.com/sites/content-scope-scripts/deploys/67439d395cc22a00084a4017
😎 Deploy Preview https://deploy-preview-1264--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Nov 24, 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 Nov 24, 2024

[Beta] Generated file diff

Time updated: Sun, 24 Nov 2024 21:45:55 GMT

@shakyShane shakyShane marked this pull request as ready for review November 24, 2024 21:44
@shakyShane shakyShane requested a review from a team as a code owner November 24, 2024 21:44
@shakyShane shakyShane merged commit 652a7cc into main Nov 25, 2024
22 checks passed
@shakyShane shakyShane deleted the shane/insecure branch November 25, 2024 11:40
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