
What is the maximum length of a bookmarklet?
I am packing whole programs into a bookmarklet to automate tasks at a workplace. What is the maximum length a bookmarklet can be in the current firefox version? I should clarify I don't have a problem, but I am requesting information.
Chosen solution
I gave it another test and can get to 65536. One byte longer and I get an error in the Browser Console.
Read this answer in context 👍 1All Replies (4)
To the best of my knowledge, because bookmarklets are handled as URLs, there's no real set limit. However, the practical limit for URLs in Firefox appears to be 32KB maximum.
Generally speaking, creating a browser extension is more practical than a bookmarklet and relatively easy to make. There's not a huge amount of extra work involved to convert a bookmarklet into an extension and you don't have to list it on the Firefox add-ons website (although you have to submit it for the automated signing process).
Hope this helps.
I think that the maximum for a bookmarklet is a few tens of bytes below 64KB (around 65500 bytes; I have one over 64000). Keep in mind that some bytes are escaped (space => %20; double-quote=> %22) and thus can take up extra space.
Honestly, I thought getting an addon signed for private distribution would be a lot more complicated then that. Thank you cor-el for answering the size question, but knowing this I will probably just make it an extension.
Chosen Solution
I gave it another test and can get to 65536. One byte longer and I get an error in the Browser Console.