Anyone write java? Can someone please make me a bookmarklet (simple) PLEASE :-)?

Ok, I can't write java, and i would like a bookmarklet to do a simple task.

I want it to amend the URL of the current page and refresh it.

Basically, it's to add my University E-Proxy to a URL, so i can quickly access a journal.


Original URL is:

Changes to:

Notice, "" is added after the root website.

It should then forward to a login page.

I would like a bookmarklet to add this automatically for me please.

This would be really helpful thanks!


Ok, it shortened the website.

it's basically (without the spaces):

www. nature. com.ezproxy4.lib. /nature/journal/vaop/ncurrent/full/ nature 11729.html

Update 2:

Ok, i did this and it worked.


1 Answer

  • 8 years ago
    Favorite Answer

    A bookmarklet is written in Javascript, not Java.

    Furthermore, it's not the right way to do this. A bookmarklet requires you to call it each time you want it to run. What you want is called a 'user script', that is to say, a Javascript program that runs automatically when you open the page.

    If you copy this code:

    // ==UserScript==

    // @name URL switcher

    // @author green_meklar

    // @include*

    // ==/UserScript==

    function switcher_check()


    var url=document.URL;



    window.location=url.replace( "", "" );




    and put it in a file ending in '.user.js', and open that file with your browser (with user script support), it should prompt you to install the user script. When the script is installed, it should perform the redirect as you wanted.

    If your browser doesn't support user scripts and has no extensions for making them work, then I can't really help you.

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.