[Fission] [meta] Fix canvas drawWindow() calls to chrome function drawSnapshot() or extension API captureTab()
Categories
(Core :: Graphics, task, P3)
Tracking
()
Fission Milestone | Future |
People
(Reporter: cpeterson, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: meta)
In bug 1664444 comment 0, zombie says:
The canvas drawWindow method is sync, and thus can't be Fission-compatible for OOP iframes.
In bug 1636508, I introduced additional arguments to the tabs.captureTab method to specify an area of the document, and the scale (devicePixelRatio). They're not documented yet on MDN, but you should be able to understand them from the schema or tests in the second patch.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
Moving to the WebExtensions product because it looks like captureTab() is a WebExtension API (bug 1427463).
Canvas drawWindow() callers need to be fixed for Fission.
Updated•4 years ago
|
Comment 2•4 years ago
|
||
I'm not sure what this bug is about exactly Chris.
My quote from bug 1664444 comment 0 was specifically about the Screenshots extensions, and the need for it stop using canvas drawWindow() method. The recommendation to switch to using tabs.captureTab() only applies to extensions. Other chrome JS (and possible c++?) users of drawWindow() probably need to switch to use WindowGlobalParent.drawSnapshot() directly, just as my implementation of captureTab() does.
If this was meant to be a "audit and fix all uses of drawWindow() in tree" meta bug, then a different product/component is probably a better place for it.
Reporter | ||
Comment 3•4 years ago
|
||
If this was meant to be a "audit and fix all uses of drawWindow() in tree" meta bug, then a different product/component is probably a better place for it.
Yes. So I'll move this bug to a more appropriate component.
We should audit the drawWindow() calls soon (Fission M6c), but actually fixing all the calls can probably happen later (Fission M7 Beta or later).
Reporter | ||
Comment 4•4 years ago
|
||
The MDN docs for drawWindow()
have a big deprecation warning:
This API cannot be used by Web content. It is synchronous, and as such can't capture cross-origin (out of process) iframes with Fission. If you're using it from an extension, you should switch to tabs.captureTab. If you're writing chrome code, you probably want WindowGlobalParent.drawSnapshot from the parent process.
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow
This Extensions blog post warns that drawWindow()
won't work with Fission and introduces the captureTab()
and captureVisibleTab()
replacement APIs:
https://blog.mozilla.org/addons/2020/10/07/extensions-in-firefox-82/
Andreas Wagner is searching the code of AMO extensions for drawWindow()
callers and DRAWWINDOW_
flags. We can then reach out to affected extension developers.
Comment 5•4 years ago
|
||
Steven, please audit the uses of drawWindow() for M6c and file bugs for the remaining uses. We should then rename this bug for fixing these uses and target it for M7.
Updated•4 years ago
|
Comment 6•4 years ago
|
||
(In reply to Neha Kochar [:neha] from comment #5)
Steven, please audit the uses of drawWindow() for M6c and file bugs for the remaining uses. We should then rename this bug for fixing these uses and target it for M7.
Done. There are uses in tests I didn't audit, but I think any test calls left after the feature code is fixed should be handled in Bug 1680359.
Comment 7•4 years ago
|
||
This is a meta tracking work related to uses of drawWindow which in some cases no longer works with Fission. There's no development work required in this specific bug.
Reporter | ||
Comment 8•3 years ago
|
||
This meta bug doesn't need to block our Fission MVP milestone. Some of the individual blocking bugs may, though.
Description
•