Closed Bug 664988 Opened 14 years ago Closed 13 years ago

Jetpack Selection's 'select' event fires too late for long loading pages

Categories

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

x86
Windows XP
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 661884
Future

People

(Reporter: mingyiliu, Unassigned)

References

Details

User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 I'm using Jetpack 1.0b5, and Selection's 'select' event is only fired after a page finishes loading. This is a problem for the (many) pages which are slow and would thus display text well before all the images etc. get loaded. The result is that any addon based on Selection would not detect user selections for considerable amount of time on a slow page. I changed line 267 of Selection.js to using 'DOMContentLoaded' instead of 'load' event, and it works very well. I hope that the change be incorporated into Jetpack release. Reproducible: Always Steps to Reproduce: 1. Write some addon code that sets a listener on Jetpack Selection's 'select' event. 2. Open a slow loading webpage 3. Double click to select a word before the "loading" icon on the tab changes to favicon Actual Results: The 'select' event is NOT fired despite that it should be, given that users made text selection. Expected Results: 'select' event be fired I changed line 267 of Selection.js (sdk-1.05b) to using 'DOMContentLoaded' instead of 'load' event, and it works very well. I hope that the change be incorporated into Jetpack release.
This is similar to, but not exactly the same as, bug 661884, which is about selection not being possible at all if a pageload was cancelled while the page is in the process of being loaded.
Priority: -- → P2
Target Milestone: --- → Future
See Also: → 661884
(In reply to comment #1) > This is similar to, but not exactly the same as, bug 661884, which is about > selection not being possible at all if a pageload was cancelled while the > page is in the process of being loaded. I think that bug can be fixed the same way. They both were due to 'select' fired only after page finishes loading. selection.js just needs to use DOMContentLoaded instead of 'load'. No platform change is needed. I made the change to selection.js a few days now and everything works fine, including the slow loading pages.
Overriding myk. :)
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.