A bookmarklet is JavaScript text stored inside of a bookmark that when clicked runs an action.

Make a bookmark and put the JavaScript code into it and then click the bookmark to use a bookmarklet.