I write a lot of bookmarklets and I put them inside a meta-bookmarklet (>20kb so far) thus:
var uGlY_vArIaBlE=(function(){
var d=document;
var f1=function(){};
var f2=function(){};
…
… /* lot of code here */
…
var f50=function(){};
});
uGlY_vArIaBlE();
Is it okay for me to assume that f50
will 'know' that d=document
as fast as f1
would? Also how does a browser actually read/interpret a script (injected or loaded from the cache)? I don't seem to be experiencing any significant delays. Any tips you could share please.