Nothing really new since there is already a firefox extension which does just the same but I also wanted support other browsers.
So this bookmarklet toggles the cookie Xdebug uses to flag if it should debug the running script or not.
Drag it to your bookmarks (or favourites or whatever is called in your browser) toolbar so it’s easy to access. Assign it a keyboard shortcut if your browser has that function.
By default it’ll prompt for the idekey to be used by Xdebug, it’s a good idea to modify the idekey variable at the start of the bookmarklet’s source with your idekey or with ‘default’ if you’re not using a DBGp proxy.