Closed Bug 1147040 Opened 5 years ago Closed 5 years ago

[Customizer] Wait for DOMContentLoaded before initializing

Categories

(Firefox OS Graveyard :: Gaia, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: justindarc, Assigned: justindarc)

References

Details

(Whiteboard: [spark])

Attachments

(1 file)

Some of the components expect `document.documentElement` to be defined when they load (such as gaia-icons). Wrapping the Customizer initialization in DOMContentLoaded should prevent these sorts of JS errors:

W/FM Radio(11735): [JavaScript Error: "TypeError: document.documentElement is null" {file: "app://customizer.gaiamobile.org/js/addon-concat.js" line: 3031}]
Assignee: nobody → jdarcangelo
Priority: -- → P1
Whiteboard: [lightsaber]
Attached file pull-request (master)
Sorry this PR is ugly and lengthy for such a small change. Pretty much the entire file had to be indented.
Attachment #8582547 - Flags: review?(drs)
Comment on attachment 8582547 [details] [review]
pull-request (master)

If this happens again, you can give people this link:
https://github.com/fxos/customizer/pull/15/files?w=1
Attachment #8582547 - Flags: review?(drs) → review+
Landed on master:

https://github.com/fxos/customizer/commit/94f9a864fb6269c162f03c5108e8af69e911b758
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Whiteboard: [lightsaber] → [ignite]
Whiteboard: [ignite] → [spark]
You need to log in before you can comment on or make changes to this bug.