bookmarkleter
bookmarkleter copied to clipboard
UglifyJS v1 provides less compression than UglifyJS v2
To diagnose an issue with SGP, I used UglifyJS2 via UglifyJS-online (site here) to recompress a prettified version of SGP.
SuperGenPass's bookmarklet size on supergenpass.com: 4633 bytes. bookmarkleter with UglifyJS: 3432 bytes. UglifyJS2 compression: 2985 bytes.
Bookmarkleter uses UglifyJS v2, not v1.
I think just about the entire size difference here can be accounted for by the URL encoding, which Bookmarkleter applies so that the result conforms to the URL spec. In some situations, bookmarklets won't be recognized as links if it hasn't been URL-encoded.
It may be the case that URL encoding is no longer necessary for bookmarklets in the major browsers, but that needs to be tested. It certainly used to be the case.