Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [91cb685]
Page Load Metrics (954 ± 525 ms)
Bundle size diffs
|
weizman
left a comment
There was a problem hiding this comment.
Looks great,
Some important comments.
Also, a more general (yet very important) comment:
We must cache the APIs we're using as part of this feature in order to not trust they aren't being modified later on. SES assures that in practice, but it's still a more secure approach in case we extend this to use APIs that aren't strictly SES protected intrinsics.
So cache and use the test property of RegExp and Error and fetch and Object.hasOwn and so on.
I can help with that part 👍
app/scripts/use-snow.js
Outdated
There was a problem hiding this comment.
uh, nothing... dead code from some earlier iteration
There was a problem hiding this comment.
removed with 1dd34f9af5
app/scripts/use-snow.js
Outdated
There was a problem hiding this comment.
I'd move this function to the upper scope (same as tamedFetch)
app/scripts/use-snow.js
Outdated
There was a problem hiding this comment.
Will do. Can you explain that suggestion a bit? I am still building up my understanding of how scuttiling works, and I suspect your suggestion here is meaningful and I could learn something by hearing your thoughts on this suggestion
There was a problem hiding this comment.
Yes of course, gladly.
"Unscuttled" is correct, because it is in fact going to be exempt from the scuttling process.
But it's not accurate enough, because "Unscuttled" really reminds something that is being completely over looked, which isn't the case here.
fetch is going to be "Unscuttled" only because we promise to tame it - that is the only legitimate excuse for excepting it from being scuttled.
That is why I think referring to it as tamed rather than unscuttled is important here - so it's clear that we mutated it in order to justify it from not being scuttled.
app/scripts/use-snow.js
Outdated
There was a problem hiding this comment.
We must use defineProperty and set configurable and writable to false. This will instruct the scuttling process to skip fetch, which would allow you to remove the exception from development/build/index.js
app/scripts/use-snow.js
Outdated
There was a problem hiding this comment.
What's the importance of the chromeExtensionId below really? I think we can allow fetching images from the chrome-extension scheme for all types of browser extension entities we create
There was a problem hiding this comment.
addressed in b769e71328
development/build/index.js
Outdated
There was a problem hiding this comment.
remove this line once #24631 (comment) is fixed
There was a problem hiding this comment.
ACTUALLY - applying the idea behind this PR to the Image exception as well could be very beneficial, as Image is also a very strong capability (just a thought)
d5c47aa to
dfd197a
Compare
…util code when creating notifications
…ty on the global reference when setting fetch
dfd197a to
08ab433
Compare
08ab433 to
3d678d7
Compare
Builds ready [e48f02d]
Page Load Metrics (729 ± 490 ms)
Bundle size diffs
|
|
An issue for further investigation into the root cause of the problem this PR addresses is here #24759 |
|
Missing release label release-11.16.6 on PR. Adding release label release-11.16.6 on PR and removing other release labels(release-11.18.0), as PR was cherry-picked in branch 11.16.6. |
Description
MV3 bug that we needto fix: #24518
In particular, we've got:
The problematic code is in not in our codebase but in chromium, here: https://github.com/chromium/chromium/blob/main/extensions/renderer/resources/image_util.js#L23-L25
You can see that function is named loadImageDataForServiceWorker and it is only used in mv3.
This breaks the browser notification feature.
As can be seen from the commit history and the comments in this PR, we attemtped some solutions that would allow us to provide a modified and tamed fetch to be used for this image fetching. However, there are unknown problems - related to how sentry uses fetch and how sentry is initialized - that interfere with the solutions we attempted. So for now, as discussed with @weizman, the latest commit on the PR just adds a scuttling exception for fetch (and for Offscreen Canvas, which is also needed for the browser notification feature).
We will return to the root problem later, and aim to remove these scuttling exceptions.
Related issues
Fixes: #24518
Manual testing steps
yarn dist:mv3Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist