Closed
Bug 877867
Opened 11 years ago
Closed 7 years ago
browser/events does not work/emit until a new window is opened
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: evold, Unassigned)
Details
Try: require('sdk/event/core').on(require('sdk/browser/events').events, 'data', function() console.log('open')) there should be a logged message but there is not, until you open a new window.
Reporter | ||
Comment 1•11 years ago
|
||
I want to work on sidebars, but I can't until this is done, unless I revert to using deprecated window-utils module..
Comment 2•11 years ago
|
||
I'm not sure why there would be a logged message since nothing changes. Can't you iterate over require("windows/utils").windows to get the currently open windows?
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → evold
Reporter | ||
Comment 3•11 years ago
|
||
Hmm this looks intentional.. Past events are not track-able with the current interface. One can only get future events. With WindowTracker I could listen to all open windows and all future opened windows all in one line of code `WindowTracker({ onTrack: create })` Now it appears I have to track all currently open & ready windows separately from future windows.. is this right? I thought the new api was going to allow to to replace the above line with `on(browserEvents, 'load', create)` but it seems I will have to add `windows().forEach(function(window) window.document.readyState == 'complete' && create(window))` beforehand..
Assignee: evold → nobody
Flags: needinfo?(rFobic)
Comment 4•11 years ago
|
||
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #3) > Hmm this looks intentional.. > > Past events are not track-able with the current interface. One can only get > future events. > > With WindowTracker I could listen to all open windows and all future opened > windows all in one line of code `WindowTracker({ onTrack: create })` > > Now it appears I have to track all currently open & ready windows separately > from future windows.. is this right? This is correct, although note that while `open` event won't occur `load` event still may, depending on weather or not there are windows that are still loading. > > I thought the new api was going to allow to to replace the above line with > `on(browserEvents, 'load', create)` > > but it seems I will have to add `windows().forEach(function(window) > window.document.readyState == 'complete' && create(window))` beforehand.. Well note that while WindowTracker did gave you onTrack and onUntrack it had also negative side of not really knowing weather window was just loaded or it has being loaded for some time. Now you have to be little bit more explicit like here: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/content/events.js#L48-L55 That being said you're point is taken, we should probably have something that would give you track / untrack for cases when that's what you care about. I'll submit a patch to do that.
Flags: needinfo?(rFobic)
Priority: -- → P2
Updated•11 years ago
|
Assignee: nobody → rFobic
Reporter | ||
Comment 5•9 years ago
|
||
Hey Irakli, are you working on this one? if not could you please unassign yourself.
Flags: needinfo?(rFobic)
Updated•9 years ago
|
Assignee: rFobic → nobody
Flags: needinfo?(rFobic)
Comment 6•7 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•