11

On my Android phone, how can a user add a bookmarklet to my Chrome bookmarks, without needing to use another device, and without copying and pasting?
I have a bookmarklet on my website that I want other people to add to their bookmarks, so I'm looking for a straightforward method.

Bookmarklets are bookmarks, but of which contain Javascript code instead of a regular web link.

Bookmarklets can be added to Chrome on the PC very easily in many ways.

  • However, on Android, if the bookmarklet is displayed as a link on a page, it cannot be "dragged to the bookmark bar" as with a PC.
  • If I try to open it in a new tab, the address bar will not contain the Javascript, so the user can't use the bookmark button.
  • Tapping the link to the bookmarklet will not put the code in the address bar either.
  • The only way I've been able to add a bookmarklet on my phone has been to tap and hold on the link, then tap "Copy link address", then edit a pre-existing bookmark's link and pasting in the bookmarklet code, then renaming said bookmark. But that's a pain, and trying to explain it to non tech savy folks isn't happening.

Is there a more simple method?

Note that I have a particular bookmarklet that even when added on my PC, does NOT sync to my Phone's bookmarks. I believe it may be due to the length (It's over 9000 characters!). This is why I need an easy method for users to save this bookmarklet.

6

You can add (and execute) bookmarklets entirely in Android Chrome.

The caveat: it takes more work than just drag-and-drop in the desktop counterpart.

Save a bookmarklet (Android Chrome)

  1. Long tap the desired bookmarklet
  2. Select Copy link address
  3. Go to Menu (three dots) and tap the Star (bookmark)
  4. BEFORE IT DISAPPEARS, tap EDIT! (at the bottom)
  5. Erase everything in the URL field, and type javascript:
    • Side note: If the url of the page is really, really long, you might want to long tap the url contents: the keyboard will appear, and then start typing immediately.
  6. Long tap at the right of the javascript: and then tap PASTE
  7. If you did it right, the begginning of URL should look somewhat like:

    javascript:(function(){lots-of-code-here...

    (The : is still in javascript:)

  8. Change the Name to something useful (you'll use it later, see below)
  9. Optional: Pick the destination Folder where you want your bookmarklet stored.
  10. When done, press the back button.
  11. You might want to test the bookmarklet. Read below:

Execute a bookmarklet (Android Chrome)

From How-To Geek (the link you sent):

In mobile Chrome, you’ll need to launch the bookmarklet from the location [address] bar. Open the web page you want to run the bookmarklet on, tap your location bar, and start searching for the name of the bookmarklet. Tap the bookmarklet’s name to run it on the current page.

  • Sorry, but I think there is some confusion here. For one, you steps are basically the same as in my 4th bullet point. Also, you don't add javascript: to bookmarklets, as they should already have that in them. Otherwise, they wouldn't be bookmarklets in the first place, and they wouldn't work by dragging them to the bookmarks on a PC. – Bort Apr 23 at 17:10
  • I don't know why people are upvoting this answer. Please read my comment above. – Bort May 8 at 17:24
  • 1
    I upvoted this because it allowed me to do something which I was not otherwise able to figure out. (Some details are different for IOS, but the hint to search for the bookmarklet rather than simply visit it was key, and probably something I would never have discovered on my own.) – tripleee Nov 9 at 14:37
  • @tripleee That's great, but that's not really how stackexchange works, you have rep to know that. Good answers should float up. This "answer" isn't an answer at all. It does not answer my question, it at best repeats it. That's not something to reward the user for. If you learned something new in happenstance, ask that question and answer it yourself. Plus this "answer" is wrong in that you don't add javascript: to bookmarklets. So now my question is misleading in that it looks like someone has already answered it when in fact, no one has. – Bort Nov 9 at 23:38
  • @tripleee If someone asks for the answer to 1+1 and someone answers with a story that doesn't give 2 or even how to find 2, but it coincidentally teaches you how to approximate pi, that does not deserve an upvote. The voting system loses its value if we use it that way. – Bort Nov 9 at 23:41
-1

Here is an easy solution.

  1. Save the bookmarklet on Chrome on your desktop give it a name, say, BM1
  2. Turn sync on the chrome browser in both desktop and mobile Chrome browsers. When the sync is on, all the bookmarks and bookmarklets gets transferred to the mobile phone as well.
  3. Now, this should make our bookmarklet accessible in the mobile chrome browser. Here is how to execute the bookmarklet: Type the name of the bookmarklet BM1 in the search bar. And, google chrome will give you suggestion based on what you type on the address bar and there will be your bookmarklet. Now, simply click the bookmarklet once you see it.
  • I'm afraid this doesn't answer the question. I am looking for a way to save it on an android device. Also I already stated that I tried saving it on my PC and it does not show in Android Chrome due to the large URL size. – Bort May 13 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.