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
4
votes
2 answers

How to make a div pop up using a bookmarklet?

How to make a bookmarklet where there's a div that pops up in the middle of the screen? Seems very simple, i just can't get it down.
chris
  • 20,791
  • 29
  • 77
  • 90
4
votes
1 answer

Differences between two regex JavaScript bookmarklets

I'm having some weird issues "improving" a bookmarklet. I took this example from here - it takes a regular expression and highlights text on the page matching the expression - I've reformatted it for easy reading using JSMin for…
Dan Caseley
  • 521
  • 6
  • 8
4
votes
1 answer

More robust way to get location.href in Javascript Bookmarklet?

This is my current bookmarklet: javascript:(function(){ alert(location.href); })(); which seems to work fine, but for me, it doesn't work on youtube under chrome for some reason.. is there a more robust way to get the location.href? Thanks.
Timmy
  • 12,468
  • 20
  • 77
  • 107
4
votes
4 answers

Creating thumbnail squares of images in javascript (without losing aspect ratio)

I am making a client side Drag and Drop file upload script as a bookmarklet. Before uploading I am using the File API to read the images into base64 format and display them as thumbnails. This is how my thumbnails look like. I want them to look more…
bits
  • 8,110
  • 8
  • 46
  • 55
4
votes
3 answers

javascript: long click for a bookmarklet

I need to recognize a long click in a JavaScript bookmarklet. So, I cannot use jQuery, neither onclick() event and similar. Is it possible, and how?
tic
  • 4,009
  • 15
  • 45
  • 86
4
votes
3 answers

Is there a javascript to remove duplicate videos in a Youtube playlist?

Since YouTube discontinued the remove duplicates button from its interface (at about the same time they discontinued their non-polymer interface), users are at a loss deduping their playlists. I've looked everywhere for tool to do that, to no avail.…
André Levy
  • 280
  • 2
  • 13
4
votes
1 answer

Making a bookmarklet in javascript

I am trying to make a bookmarklet for my website. I have made a php page that when sent a GET for example www.website.com/index.html?a=banana it will return echo 'stand'; Now I am trying to make a bookmarklet that when I press it will: Do the GET…
David19801
  • 11,214
  • 25
  • 84
  • 127
4
votes
5 answers

XPath different in IE and Firefox. Why?

I used Firebug's Inspect Element to capture the XPath in a webpage, and it gave me something like: //*[@id="Search_Fields_profile_docno_input"] I used the Bookmarklets technique in IE to capture the XPath of the same object, and I got something…
Maya
  • 7,053
  • 11
  • 42
  • 53
4
votes
2 answers

Bookmarklet which captures selected content including html tags

I'm building a JS bookmarklet which allows me to capture text that a user has selected in their browser and sends it off to a web app. I've currently checked out a couple of tutorials and have a script which looks like this: javascript:var t;try…
Ganesh Shankar
  • 4,826
  • 8
  • 43
  • 56
4
votes
1 answer

how to inject jQuery and use it in the same bookmarklet?

I can successfully inject jQuery to a page with the following bookmarklet: javascript: void((function(doc) { if (typeof jQuery == 'undefined') { var script_jQuery = document.createElement('script'); …
SparedWhisle
  • 1,370
  • 2
  • 10
  • 20
4
votes
2 answers

Bookmarklets Which Creates An Overlay On Page

I've been looking for a way to show a simple red div on the top-right corner of a page using a bookmarklet, but can't seem to find any tutorial on it on the web. Can anybody give me a quick rundown on how I can create such a bookmarklet?
Hirvesh
  • 7,636
  • 15
  • 59
  • 72
4
votes
1 answer

Bookmarklets doesnt work when run from bookmark, but works from console

I am trying to create a bookmarklet that will insert some text in a textarea on a webpage (webpage is for internal use so no point in linking). Here is example of javascript code i tried: (function(){document.getElementById("textareaID").value="Some…
Frakula
  • 145
  • 10
4
votes
3 answers

Capture keypress in Javascript (Google Docs)

I'm trying to write a little greasemonkey script/bookmarklet/what have you for Google Docs. The functionality I'd like to add needs a keypress/keyup/keydown event handler (one of those three). Unfortunately, Javascript isn't my forté, and I can't…
Jacob
  • 805
  • 9
  • 10
4
votes
1 answer

cookie not being sent when requesting JS

Question originally posted on Webmasters, was recommended to move it here. I host a webservice, and provide my members with a Javascript bookmarklet, which loads a JS sript from my server. However, clients must be logged in, in order to receive the…
Mala
  • 14,178
  • 25
  • 88
  • 119
4
votes
5 answers

Check (from bookmarklet) whether page is loaded?

I'm writing a bookmarklet javascript. The problem here is that it can be invoked by user before and after some page has finished loading. I want to ensure that the sript is run only after the page has finished loading. How to do that?
mmierins
  • 3,674
  • 4
  • 21
  • 25