Closed Bug 890579 Opened 12 years ago Closed 8 years ago

sdk/system/events subject wrapping defeats many use cases

Categories

(Add-on SDK Graveyard :: General, defect, P3)

x86
All
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: evold, Unassigned)

References

Details

I some use cases when one is using the observer service to post/emit a notification, the subject provided is altered. Using sdk/system/events the subject is wrapped and thus unobtainable to the add-on making & emitting the notification.. With the old sdk/deprecated/observer-service this use case was supported.. For instance this is how Adblock Plus allows some extensions to extend it.
* For instance this is how Adblock Plus allows some extensions to extend it this way.
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #2) > With the old sdk/deprecated/observer-service this use case was supported.. Hmm I don't know why I said this.. it looks like the wrapping has been around since 0.8 at least.. not sure it's a good idea still.
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #0) > I some use cases when one is using the observer service to post/emit a > notification, the subject provided is altered. Using sdk/system/events the > subject is wrapped and thus unobtainable to the add-on making & emitting the > notification.. That doesn't match my reading of the code but maybe I'm missing something. Looks like when emitting a notification we wrap the subject in an xpcomy object but then unwrap it when receiving notifications.
(In reply to Dave Townsend (:Mossop) from comment #3) > (In reply to Erik Vold [:erikvold] [:ztatic] from comment #0) > > I some use cases when one is using the observer service to post/emit a > > notification, the subject provided is altered. Using sdk/system/events the > > subject is wrapped and thus unobtainable to the add-on making & emitting the > > notification.. > > That doesn't match my reading of the code but maybe I'm missing something. > Looks like when emitting a notification we wrap the subject in an xpcomy > object but then unwrap it when receiving notifications. Yeah that is all right, you missed my point.
Flags: needinfo?(evold)
Assignee: nobody → evold
Priority: -- → P3
If anyone should handle this it is Irakli. I've been against the whole design of system/events in the first place.
Assignee: evold → nobody
Pinging Irakli for approval of unwrapped subjects -- I don't think it'd be too dangerous (also being a lower level API) to expose the unwrapped counterparts.
Flags: needinfo?(rFobic)
Looks like Alex requested the same thing previously bug 834288
What is the request here exactly ? Not to wrap subjects ? If so note if `wrappedJSObject` property isn't present observer will receive empty object which will be useless. If you have something along this lines in mind instead: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/output/system.js#L57-L64 https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/input/system.js#L88-L96 Than sure that's fine by me.
Flags: needinfo?(rFobic)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.