From f16bf3e62c3f36bb259b16ea058fead11e9e59ec Mon Sep 17 00:00:00 2001 From: Elwin Schotanus Date: Wed, 10 Sep 2014 09:10:15 -0500 Subject: [PATCH] Implemented loop based on hidden candidates --- src/bugsnag.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bugsnag.js b/src/bugsnag.js index 826edfa598..244f3393e6 100644 --- a/src/bugsnag.js +++ b/src/bugsnag.js @@ -640,7 +640,9 @@ // EventTarget is all that's required in modern chrome/opera // EventTarget + Window + ModalWindow is all that's required in modern FF (there are a few Moz prefixed ones that we're ignoring) // The rest is a collection of stuff for Safari and IE 11. (Again ignoring a few MS and WebKit prefixed things) - "EventTarget Window Node ApplicationCache AudioTrackList ChannelMergerNode CryptoOperation EventSource FileReader HTMLUnknownElement IDBDatabase IDBRequest IDBTransaction KeyOperation MediaController MessagePort ModalWindow Notification SVGElementInstance Screen TextTrack TextTrackCue TextTrackList WebSocket WebSocketWorker Worker XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload".replace(/\w+/g, function (global) { + var list = Object.getOwnPropertyNames( window ); + for( var i in list ) { + var global = list[i]; var prototype = window[global] && window[global].prototype; if (prototype && prototype.hasOwnProperty && prototype.hasOwnProperty("addEventListener")) { polyFill(prototype, "addEventListener", function (_super) { @@ -663,7 +665,7 @@ }; }); } - }); + } } return self;