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
18
votes
3 answers

Bookmarklet link in Markdown document

How can I include a bookmarklet in a Markdown parsed document? Is there any "tag" for markdown that basically says "don't parse this"?? For example you could have something like:
Adam Haile
  • 30,705
  • 58
  • 191
  • 286
17
votes
4 answers

Loading page and executing JS on it...from JS bookmarklet?

Essentially I'm trying to navigate to a webpage wait for that webpage to load execute a JS function/alert/whatever on that page all from a single bookmarklet. Is this possible? I can't seem to get onload to work for me, but that may be because of…
scikidus
  • 171
  • 1
  • 3
17
votes
2 answers

highlight a DOM element on mouse over, like inspect does

We have a bookmarklet, and the user clicks a button and an inspect like highligther needs to kick in. We want to this to be cross browser. For this we need to detect the DOM element during the mouse move, and once we have this element we need to…
Ionut Flavius Pogacian
  • 4,750
  • 14
  • 58
  • 100
16
votes
4 answers

Gmail conversation view toggle bookmarketlet / favelet / "scriptlet"

I noticed that if I have a gmail tab open with conversation view on/off, and then I open another tab and change the conversation view setting, my original tab stays in the conversation view state it started in such as when doing new searches etc.…
sa289
  • 700
  • 3
  • 12
15
votes
1 answer

Javascript get selected text from any textinput/textarea on the page

How can get the selected text from a textbox/textarea if I don't know which one active (focused). I am trying to create a small bookmarklet that will correct the selected text in any type of input on a page.
Baruch
  • 20,590
  • 28
  • 126
  • 201
15
votes
5 answers

Get the current url but without the http:// part bookmarklet!

Guys I have a question, hoping you can help me out with this one. I have a bookmarklet; javascript:q=(document.location.href);void(open('http://other.example.com/search.php?search='+location.href,'_self…
Bostjan
  • 151
  • 1
  • 1
  • 3
15
votes
5 answers

Modify document.location so a new tab/window is opened instead of navigation in current tab

I want to write a bookmarklet that will modify any webpage so that when the JavaScript code on that page does something like document.location = 'http://site.tld' or document.location.href = 'http://site.tld' the page will open a new tab or window…
DG.
  • 3,417
  • 2
  • 23
  • 28
15
votes
8 answers

Find all instances of 'old' in a webpage and replace each with 'new', using a javascript bookmarklet

What I want to do is replace all instances of 'old' in a webpage with 'new' in a JS bookmarklet or a greasemonkey script. How can I do this? I suppose jQuery or other frameworks are okay, as there're hacks to include them in both bookmarklets as…
Fooby
15
votes
3 answers

Javascript bookmark stopped working in Firefox 13

In Firefox version 13, bookmarklets (bookmarks with a javascript: URL, e.g. javascript: alert("it works") stopped working. Is there any solution to use javascript: bookmarks in Firefox 13?
Satya Prakash
  • 3,372
  • 3
  • 31
  • 47
14
votes
1 answer

Find all text nodes

I'm trying to write a bookmarklet that calls the function doSomething(textNode) on all instances of visible text on the document. doSomething(), just for fun, replaces every word with "derp" by replacing the textContent of the textNode passed into…
Rahat Ahmed
  • 2,191
  • 2
  • 30
  • 40
14
votes
1 answer

Allowing cross-origin requests in Yesod

My application uses a bookmarklet, and I need to allow CORS for MyRouteR so my bookmarklet code can use this route for AJAX requests. In my first draft of config/routes I gave MyRouteR support for only one request method, PUT. But it turned out…
Christian Brink
  • 663
  • 4
  • 18
13
votes
5 answers

Handler for dynamically created DOM nodes as they are inserted

I enjoy running custom scripts on pages that I do not own or control. Many times these pages have dynamically created content that I would like to apply a function to. Is this possible? If so, how can I do this? Ideally I am looking for something…
Muhd
  • 24,305
  • 22
  • 61
  • 78
13
votes
2 answers

JSLint and Bookmarklets

I'm running JSLint checks in Rhino using jslintant.js. I found something a bit strange and was wondering if I could gets some input from other programmers. Basically, the following line gets a JSLint 'Script URL' error: var a = '
Steven de Salas
  • 20,944
  • 9
  • 74
  • 82
13
votes
4 answers

How a bookmarklet can avoid the popup blocker

I wrote a bookmarklet for quickly translating selected text using Google Translator in a popup window: javascript:(function(){ var text = encodeURI(document.getSelection()); if (!text.length) { text = prompt('Texto') } var…
brandizzi
  • 26,083
  • 8
  • 103
  • 158
13
votes
2 answers

How to stop Chrome from turning relative links to absolute links on copy/paste?

I'm copying rich text from a div with contenteditable="true" and pasting it to a Medium draft. Most of the formatting is preserved fine, but for some reason I don't understand all relative links are converted to absolute ones. I don't know on what…
Ariel
  • 3,383
  • 4
  • 43
  • 58
1
2
3
90 91