inIDOMUtils is now InspectorUtils

Cameron McCormack <[email protected]> Thu, 11 Jan 2018 12:56:42 +0800
Newsgroups gmane.comp.mozilla.devel.layout
Message-ID <1515646602.2070037.1231480840.059E7B79@webmail.messagingengine.com>
Hi,

I just landed bug 1427419 on inbound, which coverts inIDOMUtils from an XPCOM interface to a [ChromeOnly] Web IDL interface named InspectorUtils. This should make dealing with this utility class simpler.

Before, accessing inIDOMUtils was done using Cc.getService(). Now, accessing InspectorUtils is done as follows:

* For plain mochitests, use SpecialPowers.InspectorUtils.  Note that this is a SpecialPowers-wrapped object, so objects you get back from calling InspectorUtils methods will be wrapped, so be careful when writing tests that perform object identity tests.

* In chrome windows, including chrome mochitests, InspectorUtils is already available on the window.

* For devtools, use `const InspectorUtils = require("InspectorUtils");`.

* For other non-Window contexts, use Cu.importGlobalProperties(["InspectorUtils"]).

Thanks,

Cameron