mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1435002 - Move Fluent's l10n.js to MozBeforeInitialXULLayout. r=smaug
MozReview-Commit-ID: GC9Yq9TxXyC --HG-- extra : rebase_source : 10c9b5f1e6c62c12725f2814aabf28dbb175f0bf
This commit is contained in:
parent
b7abed98d9
commit
8cebbf96af
@ -9,11 +9,20 @@
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function documentReady() {
|
||||
if (document.contentType === 'application/vnd.mozilla.xul+xml') {
|
||||
// XUL
|
||||
return new Promise(
|
||||
resolve => document.addEventListener(
|
||||
'MozBeforeInitialXULLayout', resolve, { once: true }
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// HTML
|
||||
const rs = document.readyState;
|
||||
if (rs === 'interactive' || rs === 'completed') {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return new Promise(
|
||||
resolve => document.addEventListener(
|
||||
'readystatechange', resolve, { once: true }
|
||||
|
Loading…
Reference in New Issue
Block a user