bookmarkleter icon indicating copy to clipboard operation
bookmarkleter copied to clipboard

UglifyJS v1 provides less compression than UglifyJS v2

Open cbowns opened this issue 10 years ago • 1 comments

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.

cbowns avatar Feb 11 '15 19:02 cbowns

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.

chriszarate avatar Feb 16 '15 21:02 chriszarate