benbusby / farside

A smart redirecting gateway for various frontend services
https://farside.link
MIT License
744 stars 46 forks source link

Bookmarklet suggestion #87

Open GlassGruber opened 1 year ago

GlassGruber commented 1 year ago

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

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 commented 1 year ago

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