Get addons to stop using DOM_OBJECT classinfo

NEW
Unassigned

Status

()

Core
DOM
2 years ago
2 months ago

People

(Reporter: bz, Unassigned)

Tracking

(Blocks: 2 bugs)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox47 affected)

Details

We need this to be able to do bug 1207321, right?
So https://mxr.mozilla.org/addons/search?string=DOM_OBJECT&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=addons says "Found 492 matching lines in 215 files".  A bunch of those are fxos emulators which we can ignore.  for the rest, it would be good to figure out whether they would actually break if we made this flag a no-op (and possibly stopped exposing XPCWrappedNative to the web)...
It looks like some of them are just using code from old tutorials, like: http://web.archive.org/web/20090221185408/http://xulplanet.com/tutorials/xulqa/q_treebview.html

What exactly does an object gain by setting this flag? Would there be a workaround available for cases where an add-on breaks?

Also, would it be possible to add a deprecation console warning to give developers time to adjust?
Peter, do you know what the current state of the answers to Jorge's first two questions is?  If no, I can try to figure it out.

For the third question, it should be possible to a deprecation warning, yes.
Flags: needinfo?(peterv)
I think the only thing we use the flag for is CanCreateWrapper.

I don't know the particulars of the treeview usage, but a lot of these are probably using JavaScript-global-property to add a property to window. Without the DOM_OBJECT flag we'll refuse to create the XPCWrappedNative's JS object around the XPCWrappedJS (the security manager will block that in nsScriptSecurityManager::CanCreateWrapper). I don't think we have an alternative for that usage.
Flags: needinfo?(peterv)

Updated

a year ago
Component: Tracking → DOM
QA Contact: chofmann
I guess this counts as an issue that will go away when XPCOM addons are no longer supported.
Blocks: 1347507
You need to log in before you can comment on or make changes to this bug.