Skip to content

Tag: greasemonkey

Clear all cookies in a userscript?

How to clear all cookies or at least restart the browser in a tampermonkey/greasemonkey script? Answer To clear the cookies edit your Chrome shortcut (or write a shell script in Linux/MacOS) and add (or use a random port number that’s not used by other processes) so you can send Network.clearBrowserCookies RDP command:

How to convert a bookmarklet into a Greasemonkey userscript?

Is there a easy way to do this. And is there anything that needs to be changed due to differences in how it is ran? Answer The easiest way to do this: Run the bookmarklet code through a URL decoder. so that javascript:alert%20(‘Hi%20Boss!’)%3B, for example, becomes: javascript:alert (‘Hi Boss!’); Strip the leading javascript: off.   Result: alert (‘Hi Boss!’); Add