Confirmed users
945
edits
(Correct MDN link) |
|||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
This page has MOVED to MDN: | |||
[https://developer.mozilla.org/en/Extensions/Performance_best_practices_in_extensions MDN: Performance Best Practices in Extensions] | |||
A list of recommendations for add-on authors to help keep Firefox fast and responsive. | A list of recommendations for add-on authors to help keep Firefox fast and responsive. | ||
==Use JavaScript Modules== | ==Use JavaScript Modules== | ||
| Line 122: | Line 121: | ||
==base64/md5/sha1 implementations== | ==base64/md5/sha1 implementations== | ||
Do not ship own base64/md5/sha1 implementations. | Do not ship your own base64/md5/sha1 implementations. Regarding base64 there are the built-in atob/btoa functions that do the job just well and are available in overlay script as well as in in js modules and components. Hashes can be computed using nsICryptoHash, which accepts either a string or an nsIInputStream. See the [https://developer.mozilla.org/en/nsICryptoHash MDC documentation for nsICryptoHash] | ||
==Image sprites== | ==Image sprites== | ||
| Line 137: | Line 136: | ||
This effectively means that javascript extensions cannot use the nsIThread API anymore to execute own jobs on different threads than the main thread. | This effectively means that javascript extensions cannot use the nsIThread API anymore to execute own jobs on different threads than the main thread. | ||
Consider Web/ChromeWorker as a replacement, which are severely limited in what you can do with them, or just don't use threads. | Consider Web/ChromeWorker as a replacement, which are severely limited in what you can do with them, or just don't use threads. | ||