Created
October 28, 2012 02:02
-
-
Save cazepeda-zz/3967172 to your computer and use it in GitHub Desktop.
Bookmarklet to append a string to the end of a URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.location.href | |
==================== | |
Bookmarklet to append a string to the end of the URL. | |
1. Create bookmark. | |
2. Edit bookmark URL(Chrome) / Location(Firefox) to include this code: javascript:window.location.href=window.location.href+'REPLACETHIS'; | |
3. Now make use of that bookmarklet. | |
Code: javascript:window.location.href=window.location.href+'REPLACETHIS'; |
How do I make a bookmarklet which adds "about:reader?url=" to the beginning of the URL?
How do I make a bookmarklet which adds "about:reader?url=" to the beginning of the URL?
Honestly, I don't think you can from a bookmarklet in modern Chrome due to the security settings. If you try to it redirects you to an about:block page.
Even from the DevTools console if you try the following it's blocked. I certainly don't want to say that it can't be done by somehow loosening security settings, via some JS glitch, or via an extension, but in terms of a traditional bookmarklet that will work for most people, I don't think it's possible. It isn't allowed in modern Firefox either.
location.href = 'about:reader?url=https://www.google.com'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
But it is still half as long :)