javascriptnpmbookmarklet

Trying to convert external code to a full fledged bookmarklet


I am trying to convert the following Javascript snippet into a regular bookmarklet by geting the code from the link and replacing the link with the direct code:

javascript:(function () { var script = document.createElement('script'); script.src="https://cdn.jsdelivr.net/npm/eruda"; document.body.append(script); script.onload = function () { eruda.init(); } })();

But, I can't get that to work for some reason. Any ideas?


Solution

  • Your URL gets too long or cannot be parsed

    For example Chrome says:

    1. That’s an error. Your client issued a request that was too large. That’s all we know.

    when I do

    javascript: (code from url)()