-
Declare
var MutationObserver
in the global scope (i.e. outside of a function) in the plugin -
Observe that
window.MutationObserver
isundefined
.
(In RES v4.1.5, this manifests asMutationObserver == undefined || null == null
) -
Remove
var MutationObserver
from the global scope code. -
Observe that
window.MutationObserver
is a constructor function, is truthy, and logs asnull
unless you cast it a little.
(After fixing this in RES, this manifests asMutationObserver
== the constructor) -
Leave out the
var MutationObserver
and add a variable that points to the MU constructor. -
Observe that the pointer works sanely.
In other words, Firefox will let you store the constructor and use it later.
Conclusion:
RES should avoid var MutationObserver
and instead use BrowserDetect.MutationObserver = window.MutationObserver || ... null
and, to create an instance, var mutationObserver = new BrowserDetect.MutationObserver(function(m) { ... });
(This is not the only option, but it seems the tidiest).