diff --git a/lib/jasmine-core/boot1.js b/lib/jasmine-core/boot1.js index 9f3401d3..0194e6c6 100644 --- a/lib/jasmine-core/boot1.js +++ b/lib/jasmine-core/boot1.js @@ -49,11 +49,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ env.configure(urls.configFromCurrentUrl()); - window.addEventListener('load', function() { + const currentWindowOnload = window.onload; + window.onload = function() { + if (currentWindowOnload) { + currentWindowOnload(); + } + // The HTML reporter needs to be set up here so it can access the DOM. Other // reporters can be added at any time before env.execute() is called. const htmlReporter = new jasmine.HtmlReporterV2({ env, urls }); env.addReporter(htmlReporter); env.execute(); - }); + }; })(); diff --git a/src/boot/boot1.js b/src/boot/boot1.js index bf0d2891..d923db8b 100644 --- a/src/boot/boot1.js +++ b/src/boot/boot1.js @@ -25,11 +25,16 @@ */ env.configure(urls.configFromCurrentUrl()); - window.addEventListener('load', function() { + const currentWindowOnload = window.onload; + window.onload = function() { + if (currentWindowOnload) { + currentWindowOnload(); + } + // The HTML reporter needs to be set up here so it can access the DOM. Other // reporters can be added at any time before env.execute() is called. const htmlReporter = new jasmine.HtmlReporterV2({ env, urls }); env.addReporter(htmlReporter); env.execute(); - }); + }; })();