Related link: http://codinginparadise.org/weblog/2005/08/ajax-creating-huge-bookmarklets.html
From Brad Neuberg:
“I’ve put together a way to have huge, arbitrarily sized bookmarklets, where most of the code resides outside of the bookmarklet link. I’ll explain how this works in this mini-tutorial.
” … The essential idea is that we dynamically insert a new script element into the DOM through our bookmarklet. …”
“This code has been tested in IE 6+ and Firefox.”
Cool.


I think the use of XMLRPC in bookmarklet is a fantastic idea.
I think this has implications way beyond "large" scripts. But rather self updating scripts as well. Think of a bookmarklet for use with a specific website that interacted with that website as changes were made. All the people all over the world using that script could then use the most up to date code. Also it could be used for voting or automatic blogrolling.
I think the use of XMLRPC in bookmarklet is a fantastic idea.
Absolutely. As I played with this technique, I quickly found it much more convenient during bookmarklet development. The bookmarklet didn't change, just the .js file.
I did find that the thread executing the bookmarklet has more authority than the thread executing the .js file. If the domain of the .js file doesn't match the page's domain, then all the usual restrictions come into play. OTOH, the bookmarklet script has special privileges.
One workaround I tried was to call a function loaded via the .js file from the bookmarklet code. To prevent a race condition, the bookmarklet sets a top.document variable that the .js file resets after fully loading.
As I recall, the function seemed to enjoy the bookmark's special privileges.