From 89ae7bbf8158aed4687da6eaed767e9292ba0ee6 Mon Sep 17 00:00:00 2001 From: Darren Date: Wed, 22 Oct 2014 20:19:52 +0100 Subject: [PATCH] document unload promise resolving correctly with promise shim --- client/src/index.html.tmpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/index.html.tmpl b/client/src/index.html.tmpl index 71c1d00..a47084c 100644 --- a/client/src/index.html.tmpl +++ b/client/src/index.html.tmpl @@ -471,6 +471,12 @@ } onload_promise = new Promise(function (resolve) { + // Document may already be loaded if we had to load the Promise shim seperately + if (document.readyState === 'complete') { + resolve(); + return; + } + window.onload = resolve; }); -- 2.25.1