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
12
votes
1 answer

Mobile Safari Blocks Javascript in URL - Safari cannot run the script because JavaScript is not allowed to be used this way

I was researching how to create bookmarklets for use with mobile safari and I ran across this problem: I'm not sure why am unable to find any questions on this topic. And my Google searches came up with nothing as well. But it appears that iOS has…
JayGee
  • 577
  • 6
  • 16
12
votes
6 answers

Change CSS of selected text using Javascript

I'm trying to make a JavaScript bookmarklet that will act as a highlighter, changing the background of selected text on a webpage to yellow when the bookmarklet is pressed. I'm using the following code to get the selected text, and it works fine,…
Chris Armstrong
  • 3,585
  • 12
  • 42
  • 47
12
votes
5 answers

How do I disable position:fixed in web pages?

This website: http://nautil.us/ has a really annoying header that is always on screen and won't scroll away. If I right-click on it and 'inspect element' in firefox, then I find that the css contains "position: fixed;", and if I untick this, the…
John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
12
votes
7 answers

scripting a google docs form submission

I'm trying to create a bookmarklet that parses a page and sends the results to a googledocs spreadsheet via a form that I've defined. The relevent bit of the script is: var form = document.createElement("form"); form.action =…
justSteve
  • 5,444
  • 19
  • 72
  • 137
12
votes
1 answer

Is there any difference in JavaScript injection and bookmarklet?

As per the Wikipedia article on Bookmarklets (http://en.wikipedia.org/wiki/Bookmarklet), the concept of Bookmarklets is: Web browsers use URIs for the href attribute of the tag and for bookmarks. The URI scheme, such as http:, file:, or ftp:,…
11
votes
1 answer

javascript bookmarklet does not work in new tab in chrome

I have this javascript bookmarklet This appends the prompted value to www.oracle.com and opens that url in tab. javascript:window.location.href='http://www.oracle.com/'+prompt("Please enter your input:", "exadata"); In firefox, this works fine. If…
Kuldeep Singh
  • 1,214
  • 4
  • 18
  • 45
11
votes
2 answers

Bookmarklet to open a new window forwards current window to [Object Window]?

I am using a small bookmarklet which opens a webpage in a new window. It works properly on chrome. However, when I use the same in Firefox it opens a new window with new web page but the page on which this bookmarklet was clicked is forwarded to…
Lalith
  • 19,396
  • 17
  • 44
  • 54
11
votes
6 answers

Why setTimeout() function runs only once?

I am making a javascript bookmarklet that resizes all images, periodically. javascript: function x(){ for(i=0;i<=document.getElementsByTagName('img').length;i++) document.getElementsByTagName('img')[i].width+=1; }; t =…
Shubham
  • 21,300
  • 18
  • 66
  • 89
11
votes
1 answer

Create bookmarklet to fill form

I want to create a bookmarklet that fills in 1st, 2nd, 5th and 6th text box with text so I can use the tool on the site more easily, because I use it frequently & it doesn't remember my input. These are the ones with this text in front "Vertrek…
user1430392
  • 121
  • 1
  • 1
  • 3
10
votes
2 answers

Ajax call from Bookmarklet

I am trying to create a bookmarklet that, upon clicking, would request some information from the user (a url and a couple other fields in this case) and then send that data to a php page on my server and then display the result. I would like to do…
Adam Haile
  • 30,705
  • 58
  • 191
  • 286
10
votes
2 answers

Bookmarklet: Append hidden iframe to page and load url

I have a bookmarklet for resetting my router. I just need to visit and let the page finish loading, then my router starts…
Sindre Sorhus
  • 62,972
  • 39
  • 168
  • 232
10
votes
3 answers

Bookmarklet to make URL from Clipboard content

I'm trying to make a Bookmarklet to grab an id value from the Clipboard, and navigate to a URL that is built with that id. javascript:(function(){ window.location="index.php?module=Accounts&action=DetailView&record=" +…
pgr
  • 898
  • 11
  • 27
10
votes
2 answers

Bookmarklet security considerations, CSRF, hashed key

My bookmarklet can be called from any website and basically allows the user to insert a row into his collection from afar - if he is logged in. Now I want to enable CSRF protection for my site and since a bookmarklet is basically non-forged cross…
Ruben
  • 3,452
  • 31
  • 47
10
votes
4 answers

How to CSS sandbox/reset an entire DIV area in the current page?

We are developing a bookmarklet, and when the bookmarklet loads on different websites, eg: cnn.com, bbc.co.uk, yahoo.com it displays in various styles and we have struggle to reset these styles. The bookmarklet content is in the current page DOM and…
Pentium10
  • 204,586
  • 122
  • 423
  • 502
9
votes
3 answers

Debugging bookmarklets in Firefox

I would like to debug bookmarklets. How can I do this? Preferably in Firefox. Bookmarklets has only one line of code so direct debugging them is impracticable. If I create "script" tag with code which I send from bookmarklet, code from this "script"…
Greck
  • 580
  • 6
  • 15
1 2
3
90 91