Closed
Bug 661884
Opened 14 years ago
Closed 12 years ago
Selection events occur only after (successful!) page load
Categories
(Add-on SDK Graveyard :: General, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: tlainson, Assigned: zer0)
References
Details
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20110321 Firefox/4.0
Build Identifier: Addon SDK 1.0rc1, Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20110321 Firefox/4.0
As far as I can tell:
Selection events aren't fired while the page is still loading (minor annoyance). If the pageload is cancelled by the user, the addon will never receive selection events for that page (more serious).
In both cases, selection.text and selection.html return the correct values. We're just not informed that they've changed.
Reproducible: Always
Steps to Reproduce:
1. require("selection").on('select', function() console.log('boo!'));
2. Visit a slow website.
3. Select some text while the page is still loading.
4. Press <Escape> while the page is still loading, then select some other text.
Actual Results:
No output.
Expected Results:
"boo!" printed twice.
Comment 1•14 years ago
|
||
This might require a platform change to fix; I think we wait until the page is loaded to start listening for selections because the API we're using requires it.
Priority: -- → P2
Target Milestone: --- → Future
Matteo, do you have any insight into whether we need a platform change or if this is something we can do ourselves?
Whiteboard: [triage:followup]
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: Future → ---
Still waiting for input from Matteo.
Whiteboard: [triage:followup]
Whiteboard: [triage:followup]
Updated•13 years ago
|
Assignee: nobody → zer0
Priority: P2 → --
Assignee | ||
Comment 6•13 years ago
|
||
I will check again this bug after I fixed the bug 751469. However I'm quite confident that Myk is right.
Assignee | ||
Comment 7•13 years ago
|
||
In `selection.js` we're using the `Tracker` exposed by `tab-browser` module, so we have the load event only when the page is actually fully loaded.
Maybe we can fix it using the observer topic "document-element-inserted" instead; adding listeners at that point seems works.
We have just to be sure that we limit that behavior to the document loaded in tabs, and figure out in which event doing the clean up.
Assignee | ||
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P1
Whiteboard: [triage:followup]
Assignee | ||
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•