Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookmarklet suggestion #87

Open
GlassGruber opened this issue Feb 6, 2023 · 1 comment
Open

Bookmarklet suggestion #87

GlassGruber opened this issue Feb 6, 2023 · 1 comment

Comments

@GlassGruber
Copy link

GlassGruber commented Feb 6, 2023

Hei there!
I've made a simple bookmarklet and is pretty self-explanatory.

  • if you are viewing https://example.com/some-url the bookmarklet will open the current page with your service as https://farside.link/https://example.com/some-url
  • on a blank/new tab it will open a prompt where the user can paste the link it want to redirect or just press enter and navigate to farside website.

Pretty print:

javascript: (function ()
        {
            if (location.href.indexOf('http') != 0)
            {
                mex = 'Insert URL or press enter to open https://farside.link/'
                input = prompt('URL:', mex);
                if (input == mex || input == null)
                {
                    location.href = 'https://farside.link/';
                }
                else
                {
                    location.href = 'https://farside.link/' + input
                }                
            }
            else
            {
                location.href = 'https://farside.link/' + location.href;
            }
        })();

Minified:

javascript:(function(){if(location.href.indexOf('http')!=0){mex='Insert URL or press enter to open https://farside.link/';input=prompt('URL:',mex);if(input==mex||input==null){location.href='https://farside.link/'}else{location.href='https://farside.link/'+input}}else{location.href='https://farside.link/'+location.href}})();

If you think it's useful use it as you see fit, maybe in the readme, in the wiki or on your website as a draggable link tool.

Thank you this is a very slick little web service indeed! 🎩👌

@apraile
Copy link

apraile commented Feb 17, 2023

Thanks @GlassGruber !
Very useful for Tor Browser users because it is not recommended to install extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants