Questions tagged [bookmarklet]

A bookmarklet is a browser bookmark for a URL using the 'javascript:' protocol. The 'javascript:' prefix is followed by a snippet of JavaScript code. When invoked, instead of navigating to a new page, the script is executed within the context of the current page.

A bookmarklet is a browser bookmark for a URL using the javascript: protocol. The javascript: prefix is followed by a snippet of JavaScript code. When invoked, instead of navigating to a new page, the script is executed within the context of the current page.

1355 questions
5
votes
3 answers

GWT bookmarket or GWT as an external library

I simply want to load a GWT(Google Web Toolkit) app by adding a script tag to the DOM, however because the GWT linker uses document.write() I'm unable to find any good way of doing so. I've found some hacks for doing so on various blog posts but…
Abdullah Jibaly
  • 53,220
  • 42
  • 124
  • 197
5
votes
0 answers

How do I distribute my bookmarklet conveniently?

I just wrote my first bookmarklet. It is simple js code which takes the current page's URL and does a POST request to submit it to another page. The problem is that I need to share this on a blogging platform (quora.com) that does not allow HTML.…
Mohan S Nayaka
  • 345
  • 3
  • 9
5
votes
1 answer

Using localstorage in bookmarks

I quite like using bookmarks with small scripts in them. For example, I have edited the note editing script from this post on Reddit to automatically save and load the last note via localstorage. ... window.addEventListener("load", function () { …
Azeirah
  • 6,176
  • 6
  • 25
  • 44
5
votes
1 answer

unable to run an external javascript using a bookmarklet

Totally newbie about JS. I need to use an external script which modifies some elements in the current page accessing it as a bookmarklet. If I modify the html source code of the web page inserting the following < script >…
tic
  • 4,009
  • 15
  • 45
  • 86
5
votes
2 answers

What is the best practice for writing bookmarklets

I am writing some bookmarklets for a project that I am currently working on and I was wondering what the best practice for writing a bookmarklet was. I did some looking around and this is what I came up with javascript:void((function() { …
Ritesh M Nayak
  • 8,001
  • 14
  • 49
  • 78
5
votes
1 answer

JavaScript bookmarklet and URL encoding

Fully disclosing that I do not know Javascript, I'm trying to get this Javascript: javascript:location = 'http://validator.w3.org/check?uri='…
markratledge
  • 17,322
  • 12
  • 60
  • 106
5
votes
1 answer

Calling a function created inside a bookmarklet

I'm trying to write a bookmarklet which adds a JSONP call into a page like this: javascript:(function(){ var myFunction = (window.function(data){alert('my function is firing with arg' + data)}); var j = 'http://localhost/jsonscript.js'; var s =…
AmbroseChapel
  • 11,957
  • 7
  • 46
  • 68
5
votes
2 answers

Why does appending to innerHTML in a bookmarklet overwrite the entire page?

I have this little bookmarklet: javascript:document.getElementsByTagName("div")[0].innerHTML+="Chuck Norris"; Now it's obviously supposed to take the very first div on the page, and add Chuck Norris into it. Instead, when pasted on the address bar,…
seanlevan
  • 1,367
  • 3
  • 15
  • 33
5
votes
3 answers

Get file path of currently executing JavaScript code for dynamically loaded cross domain JavaScript file

I need to load cross-domain JavaScript files dynamically for bookmarklets in my site http://jsbookmarklets.com/ The solution should satisfy: Fetch the path of current file The domain of current web-page and JS file in execution are different The…
5
votes
1 answer

jQuerify not working with facebook on chrome

jQuerify is a small bookmarklet to add jquery support to the web page currently displayed. Take a look at this page: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet/ This demo let me know if jquery is already…
skyrail
  • 139
  • 1
  • 7
5
votes
2 answers

elementFromPoint returns null after scrolling the page

I have a javascript bookmarklet I put together to make an arduous task a little more bearable. Essentially I am going through hundreds of pages of training material and making sure that all of it has been properly swapped from Helvetica to Arial.…
Chris O'Kelly
  • 1,863
  • 2
  • 18
  • 35
5
votes
1 answer

Find and replace in a webpage using javascript

What I want to do is replace all instances of 'foo' in a webpage with 'bar' in a JS bookmarklet/greasemonkey script. How can I do this? I suppose jQuery works, as there're hacks to include those in both bookmarklets and greasemonkey scripts.
Fooby
5
votes
2 answers

Possible to run Javascript from address bar (bookmarklet) within Google Chrome's settings panel?

I would like to make a bookmarklet to open google chrome's settings panel and clear my cache with a single click. For a while now, Ive had a bookmark that opens chrome's settings panel with the 'clear cache' setting already selected. After clicking…
bradleygriffith
  • 948
  • 3
  • 11
  • 24
5
votes
4 answers

Making/finding html5 validator bookmarklet

I want to find or make a bookmarklet that will validate the html content of a currently viewed page using the W3C HTML 5 validator. I have found two bookmarklets and am trying to get one to behave a bit like one and a bit like the other, however I…
Damon
  • 10,493
  • 16
  • 86
  • 144
4
votes
1 answer

What's the most efficient way to toggle a localStorage value with a bookmarklet?

I have a switch that I'd like to turn on and off in my browser's localStorage using a bookmarklet. What would be a good bookmarklet for toggling the value of a hard-coded key between "0" and "1"?
Rich Armstrong
  • 1,432
  • 2
  • 16
  • 20