3 ms·
This seems to work as well: javascript:open('https://old.reddit.com/r/xyz/submit?url=' + encodeURIComponent(location.href)) Notes: 1. u don't have to use `
by gabrielsroka 2y ago
This seems to work as well:
javascript:open('https://old.reddit.com/r/xyz/submit?url=' + encodeURIComponent(location.href))
Notes:
1. u don't have to use `window.`, window is the default object (maybe less readable, but folks don't use window.fetch either)
2. using an IIFE is sometimes useful and necessary, but this is a simple bookmarklet
3. as i wrote in the other comment, u don't need to encode it, and if u did, you could use encodeURIComponent to do it for you. ie, show the plain code here and let someone encode it if necessary (but i've never encoded mine)
I've posted several bookmarklets here: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=bookmarklet%20gabrielsroka&sort=byDate&type=all https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...