You can use the Snippet editor in Chrome which is an IDE with a debugger. Then Save As. If u prefix them with `javascript:`, you can drag/drop or copy/paste to the bookmark bar.
https://developer.chrome.com/docs/devtools/javascript/snippe... and
https://developer.chrome.com/docs/devtools/javascript/refere...Firefox also has a nice console.