back

by gregsadetsky·14y ago·view on hn ↗
You shouldn't try to fit your code in that bookmarklet...! Updatability issues aside (your original, server-loaded approach is absolutely valid), there definitely are limits to a bookmarklet's size, just as there are browser-specific limits to URL length... See: http://stackoverflow.com/questions/417142/what-is-the-maximu...

EDIT: _jb's right regarding the security concern though; the server-hosted code could be changed to something malicious after everyone has installed it

1 comments
To solve the security issue, the bookmarklet could perform some sort of hash checking on the source and refuse to run if it's changed.

The question is, can a hash function and verification logic be made small enough for this to be viable?

Use MD5, very secure snickers