rlr / dotjs-addon

[unmaintained] ~/.js for Firefox
BSD 3-Clause "New" or "Revised" License
144 stars 17 forks source link

Inject scripts on document ready #26

Closed bpierre closed 11 years ago

bpierre commented 11 years ago

Huge speed improvement :-)

In most cases, the document ready event is what a developer want. If necessary, it’s easy to use window.addEventListener('load', …) to listen for the window onload event.

rlr commented 11 years ago

Awesome! Do you know if this may cause some scripts to not work right anymore?

bpierre commented 11 years ago

Only if the script relies on fully loaded ressources, e.g. get the dimensions of an image without width and height attributes, and did’nt already use a "window load" event.

Most of the time, developers only need to get CSS dimensions, positions etc., which are present on document ready, so I guess 99% of the existing scripts won’t be affected.

rlr commented 11 years ago

Landed 9f3361f85b758c4a0874b318fcfad79fda89f17d

Thanks!

rlr commented 11 years ago

I submitted a new version with this patch to AMO! Awaiting review now... Thanks!

bpierre commented 11 years ago

Cool :-)