inIDOMUtils is now InspectorUtils

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

inIDOMUtils is now InspectorUtils

Cameron McCormack-4
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
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: inIDOMUtils is now InspectorUtils

Patrick Brosset
This is wonderful Cameron!
Thank you for making this part way easier.

On Thu, Jan 11, 2018 at 5:56 AM, Cameron McCormack <[hidden email]> wrote:

> 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
> _______________________________________________
> dev-developer-tools mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-developer-tools
>
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout