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

Select Element By Class in IE Quirks Mode

I am trying to create a bookmarklet for a page that is rendering in IE in quirks mode. I have no control over the source of the page so telling me to change the doctype will not work. Anyway, I am trying to get an element by its class but it seems…
Davin Studer
  • 1,501
  • 3
  • 15
  • 28
0
votes
2 answers

JavaScript: bookmarklet to show UTF-8 characters correctly

I am reading some pages that don't display correctly some UTF-8 characters. For example this page shows – instead of en dash (–). Others: showing ’ instead of ’ showing ‘ instead of ‘ (see this page) Is it possible to fix this problem in a…
BearCode
  • 2,734
  • 6
  • 34
  • 37
0
votes
2 answers

url decode - doesn't work

why does the following decoded script not work? The original code seems to run just fine. javascript:(function(s){try{s=document.selection.createRange().text}catch(_) {s=document.getSelection()}prompt('State the question and answer below.','Q.' s…
query
  • 27
  • 1
  • 2
  • 4
0
votes
1 answer

Can a Chrome bookmark contain a lot of javascript?

I'd like to create Chrome bookmarks that perform actions when clicked. The vast majority of them will be manipulating the URL and reloading the page. Can you make Chrome bookmarks that contain large amounts of Javascript? Maybe even jQuery?
user1729506
  • 975
  • 4
  • 15
  • 28
0
votes
0 answers

How to get current URL by JavaScript bookmarklet before loading that URL?

It seems that the JS bookmarklet cannot get the current URL from the browser address bar if the page of URL is not loaded. I have tried the followings but not work. (in FF…
northtree
  • 8,569
  • 11
  • 61
  • 80
0
votes
2 answers

What are the issue with putting markup outside ?

I have a bookmarklet storing a lot of DOM data, but I would love to avoid to put them out of the body tag so the script in the page won't mess with it. Semantic value is not an issue for once, but I would like to know : will it trigger some browser…
Bite code
  • 578,959
  • 113
  • 301
  • 329
0
votes
1 answer

bookmarklet - loading jquery and jquery UI if not loaded, checking a minimum version and in the right order

Im creating a bookmarklet that requires jquery and jquery ui and am having trouble getting a robust/flexible version working (have trawled S.O and various blogs) but they either seem to only check one file is loaded (e.g. jQuery) or just load jQuery…
Adi
  • 4,034
  • 13
  • 56
  • 78
0
votes
2 answers

Not sure where my Regex went wrong

I'm writing a Javascript bookmarklet as a side project for work (don't code for a living, very much a beginner). It scans through a cnn.com transcript and picks out the names and titles of the live guests, excluding those that are played from…
babyjordan
  • 39
  • 7
0
votes
1 answer

Using Facebook API via a bookmarklet

I am attempting to develop a bookmarklet that scrapes the user's current web page and stores some data pulled from it. On my own website, my users sign in via the Facebook API. When my bookmarklet is used, I can successfully present the Facebook…
Ben Packard
  • 26,102
  • 25
  • 102
  • 183
0
votes
2 answers

How is this JavaScript object created for this bookmarklet?

I am trying to reverse engineer a bookmarklet that uses CasperJS. It creates an object called __utils__ that I can execute console commands with. The link to the bookmarklet is here:- http://casperjs.org/api.html#bookmarklet Which references this…
Lush
  • 3
  • 1
0
votes
1 answer

error in bookmarklet and not in javascript

I am managing Bookmarklet, that when it clicked create a smiley on any website. Javascript is perfectly working but I cannot make that same script work perfectly from bookmarklet(annoying output). javascript jsfiddle bookmarklet jsfiddle Now what…
vusan
  • 5,221
  • 4
  • 46
  • 81
0
votes
1 answer

combining 2 bookmaklets

I have 2 separate bookmarklets javascript: (function () { var url = document.location; var links = document.getElementsByTagName('link'); var myvar = 'none'; for (var i = 0, l; l = links[i]; i++) { if (l.getAttribute('rel') == 'next') { myvar =…
0
votes
1 answer

How do i improve this bookmarklet?

Here's the code: javascript:(function()%7B%20window.open('http://www.google.com/');%20%7D)();%20javascript:(function()%7B%20window.open('http://www.magesy.me/');%20%7D)(); How can i get like a two or three second delay on the second tab opening?
0
votes
0 answers

Overlay jQuery Lightbox with Bookmarklet

Looking to create a bookmarklet that let's users store useful information. Is it possible to create a bookmarklet that loads a jQuery lightbox on click? I can get it working on my own domain, but the lightbox doesn't load when on a different domain…
PaperChase
  • 1,557
  • 4
  • 18
  • 23
0
votes
2 answers

Javascript injection on other sites

I would like to host links in my site. That contain onlick event and open in new tab. While opening or after loading, it need to add some code within the loaded page. Is this possible? And also it need to add onclick event in all links within the…
Suyu Tu
  • 11
  • 1