Question

I have a javascript link (works like a plugin, but not plugin, it's just a javascipt link), the user can just drag and drop the link to it's bookmark bar.

Everything is working, but when the URL/location link is too long, it's very annoying that when the use mouses over the bookmark, it will also show the URL/Location link.

So is there a way not to display the URL/Location link when mousing over?

  • It would be better if we can display a customized description;
  • It would be better if it works for all major browsers;
  • It would be better if it's cross-platform;
  • Any reasonable suggestions or even hacks are also welcomed as long as it will improve the user experience.

Thanks.

Was it helpful?

Solution

So is there a way not to display the URL/Location link when mousing over?

Not without modifying the browser at a deep level. And if you are going to do that, you don't need to use a bookmarklet.

But you can add a comment to the code to explain it.

Example:

javascript:/*--A-very-short-description--*/document.location=...

I choose to use - instead of spaces because spaces are encoded to %20, which is much worse that - for reading.

This won't hide the code, but it does make the bookmarklet slightly more friendly.

Using this, there is a slight trick that in Firefox and maybe other browsers that sort of "hides" the code. Firefox shows only the beginning and ends of the code, not all of it. So if you code begins and ends with a comment, you can effectively hide the code.

Approximate example:

javascript:/*------------------------*/document.location=.../*------------------------*/

In Firefox this will look something like "javascript:/------------...--------------/"

You can experiment with the details to get the desired result.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top