Closed Bug 2032462 Opened 1 month ago Closed 1 month ago

Guard document.dir access in Nova render paths for startup cache worker compatibility

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: maxx, Assigned: maxx)

References

Details

Attachments

(1 file)

When nova.enabled is true by default, three component render functions access document.dir unconditionally. The about:home startup cache is built via ReactDOMServer.renderToString inside a Web Worker where document is not defined, causing construction to fail silently and breaking the startup cache.

Guard each access with typeof document !== "undefined" in:

  • WallpaperCategories.jsx
  • SectionsMgmtPanel.jsx
  • WidgetsManagementPanel.jsx

The about:home startup cache is constructed via ReactDOMServer.renderToString inside a Web Worker where document is not defined. With nova.enabled now true by default, three render-path functions access document.dir unconditionally, causing startup cache construction to fail with "document is not defined".

Guard each access with typeof document !== "undefined" in WallpaperCategories, SectionsMgmtPanel, and WidgetsManagementPanel.

Attachment #9570651 - Attachment description: WIP: Bug 2032462 - Guard document.dir access in Nova render paths for startup cache worker r?#home-newtab-reviewers → Bug 2032462 - Guard document.dir access in Nova render paths for startup cache worker r?#home-newtab-reviewers
Pushed by mcrawford@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/349ae7ce0948 https://hg.mozilla.org/integration/autoland/rev/76ef2bcb5a01 Guard document.dir access in Nova render paths for startup cache worker r=home-newtab-reviewers,mconley
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: