As written on bug 1122583 we will have problems with data kept in the global context of a execute_script call. Tests and other modules could reset the sandbox and the formerly set data is lost. Especially registered callbacks for events and observers can leak that way. We should update all of our modules to explicitly always use new_sandbox=False for the time being. We should also ensure to only store those variables on `global` or `this`, which really have to retain state between multiple calls.
So, I just realized that the implementation sandbox re-use in bug 755036 clobbers the sandbox when switching between windows, which is going to cause this to be incorrect. This was for consistency with the implementation on the content side (and it does that because the current window is used as the prototype for the execution sandbox, as is the case in chrome context). I think we're best off for the moment hanging observer/event state off of testUtils as discussed in 1122583.
ni? just to make sure you see this before spending cycles going down this road. Sorry, I should have thought of this before.
Yes, observer/event handling is currently on hold. I will implement something similar with the identical API on bug 1123401.
Assignee: hskupin → nobody
Bug 1149618 actually implemented a way to use multiple sandboxes and retain values between invocations. Means there is no need for this workaround anymore and we can go ahead with the observer implementation.
You need to log in before you can comment on or make changes to this bug.