I don't think this is really a regression, the WebIDL bindings have always worked like this and I don't remember that pre-WebIDL bindings had a mechanism for chrome-only interfaces (pretty sure we just exposed all nsIDOM* interfaces). (In reply to :Gijs (he/him) from comment #6) > In some further testing I'm struggling to consistently reproduce things - is the trick here that things are only exposed once some chrome actor accesses the thing in question, or something? The specific conditions are that chrome code creates a WebIDL object in the web content global's scope but for a WebIDL interface that's marked `[ChromeOnly]`. For example chrome code doing `webContentWindow.createAFoo()`, or when we're calling an event handler in chrome code for an event created in the web content global and fired on an object from the web content global's scope. That will wrap the WebIDL object from the web content scope in an Xray before passing it to the chrome code. If at that point the chrome code has not accessed the WebIDL *interface object* for that interface (eg by enumerating the properties on the web content global or something), then we'll define a property on the web content global for that `[ChromeOnly]` interface. We do have to create the WebIDL interface object, so that we can wrap it in an Xray too (and put it on the prototype chain for the Xray for the WebIDL object), but we might be able to skip defining the property.
Bug 1906744 Comment 14 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I don't think this is really a regression, the WebIDL bindings have always worked like this and I don't remember that pre-WebIDL bindings had a mechanism for chrome-only interfaces (pretty sure we just exposed all nsIDOM* interfaces). (In reply to :Gijs (he/him) from comment #6) > In some further testing I'm struggling to consistently reproduce things - is the trick here that things are only exposed once some chrome actor accesses the thing in question, or something? The specific conditions are that chrome code creates a WebIDL object in the web content global's scope but for a WebIDL interface that's marked `[ChromeOnly]`. For example chrome code doing `webContentWindow.createAChromeOnlyFoo()`, or when we're calling an event handler in chrome code for an event created in the web content global and fired on an object from the web content global's scope. That will wrap the WebIDL object from the web content scope in an Xray before passing it to the chrome code. If at that point the chrome code has not accessed the WebIDL *interface object* for that interface (eg by enumerating the properties on the web content global or something), then we'll define a property on the web content global for that `[ChromeOnly]` interface. We do have to create the WebIDL interface object, so that we can wrap it in an Xray too (and put it on the prototype chain for the Xray for the WebIDL object), but we might be able to skip defining the property.