Closed Bug 1680359 Opened 5 months ago Closed 11 days ago

[Fission] [meta] Deprecate the Canvas drawWindow() method for extensions

Categories

(WebExtensions :: General, task, P2)

task

Tracking

(Fission Milestone:M7a)

RESOLVED FIXED
Fission Milestone M7a

People

(Reporter: cpeterson, Assigned: zombie)

References

(Blocks 2 open bugs)

Details

(Keywords: meta)

CanvasRenderingContext2D.drawWindow() won't work in some cases with Fission. If you're calling drawWindow() from an extension, you should switch to browser.tabs.captureTab(). If you're writing chrome code, you probably want to call WindowGlobalParent.drawSnapshot() from the parent process.

The WebExtension deprecation policy says we need to:

  • ⬜ Announce on the dev-addons mailing list with the subject "Intent to deprecate".
    • An Extensions blog post announced that drawWindow() won't work with Fission and introduced the captureTab() and captureVisibleTab() replacement APIs.
    • And mentioned in this Fission announcement in the Add-ons Discourse forum.
    • But we should still post a Discourse announcement with the subject "Intent to deprecate CanvasRenderingContext2D.drawWindow()"
  • ⬜ Alter the addons-linter repository to warn developers using "web-ext lint" or AMO that the API is now deprecated. (addons-linter team recommends emailing authors instead: https://github.com/mozilla/addons-linter/issues/3661)
  • ✅ Alter Firefox to output a warning to the browser console: bug 1696976
  • ✅ Update the docs on MDN. 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.

  • ⬜ Wait for change to ride the change to ride Firefox trains to release.
  • ⬜ At a minimum, wait for 3 Firefox releases, from when the deprecation lands in nightly.
  • ⬜ Alter the add-ons linter repository to fail if the API is present.
  • ⬜ Alter Firefox to remove the API: bug 1682545
  • ⬜ Update the docs on MDN.

Andreas Wagner is searching the code of AMO extensions for drawWindow() callers and DRAWWINDOW_ flags. We can then reach out to affected extension developers.

Assignee: nobody → tomica
Severity: -- → N/A
Priority: -- → P2
Depends on: 1682355
No longer depends on: 1682355
Blocks: 1682545
No longer blocks: 1682545
Summary: [Fission] [meta] Deprecate and remove the CanvasRenderingContext2D.drawWindow() API → [Fission] [meta] Deprecate the Canvas drawWindow() method for extensions
Blocks: 1682545
No longer blocks: 1678480
Depends on: 1696976

This meta bug doesn't need to block the Fission Beta experiment (M7). Looks like the drawWindow deprecation warning in bug 1696976 will land in time for M7, which will help diagnose beta bug reports related to screenshots.

Fission Milestone: M7 → M7a

Tomislav, now that we're logging an API warning (bug 1696976), it looks like the next steps (from comment 0) for drawWindow deprecation are:

  • Post a Discourse announcement with the subject "Intent to deprecate CanvasRenderingContext2D.drawWindow()"
  • Alter the addons-linter repository to warn developers using "web-ext lint" or AMO that the API is now deprecated.

Where should I file a bug for the addons-linter changes? We should add the addons-linter warning before we ship Fission, but I don't think we need to actually remove the drawWindow API or change the addons-linter warning to an error before we ship Fission.

Flags: needinfo?(tomica)

Here's the addon linter bug https://github.com/mozilla/addons-linter/issues/3661, it looks like people are leaning toward a one time email to devs instead of a linter warning.

I'll work with Caitlin for the email and the Discourse announcement, potentially for next week.

Flags: needinfo?(tomica)

Deprecation announced on Discourse and targeted emails scheduled, closing this.
https://discourse.mozilla.org/t/deprecation-announcement-for-canvas-drawwindow-method/79685

Status: NEW → RESOLVED
Closed: 11 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.