SafeUrl, automatically converts links from "safe:" to "http:" protocol


SafeUrl is a simple script that converts all external links of your safesite between the safe protocol (safe://xxx.yyyy) and the http protocol (http://xxx.yyyy.safenet) depending on which browser you are using.

How it works

  • Add the script safe_url.js to all your web pages that contains links to convert (note: relative links don’t need to be converted).
  • Add the css class “safe_url” to the links you want converted.

That’s it, your safesite is now compatible for the Safe browser and other browser (tested Chrome and Firefox). Here’s a live example on Alpha.

You can also call the function convert_to_http_protocol(url) and convert_to_safe_protocol(url) manually if you need to do it dynamically.

Now a bit of self-promotion. I setup a github account where I uploaded all my projects, feel free to clone / push request / fork any of it.



I wonder that could become within the safe browser and save webmasters having to think about it.

Yes, I think this is very good as a temporary thing, but if we want web adoption we definitely need the safe browser to do it automatically. I think we should be able to run any web site without change on safe net, as long as the files are uploaded on the safe net of course.

Now, perhaps you sometimes still want a ref to a clear net URL from a safe net page (especially during migration stage of the web sites) so you don’t want the safe browser to automatically convert.

Surely only urls with domain ending .safenet would be converted.


We definitely need a firefox/chromium/IE safenet plugin for that. Otherwise it is a long and tough uphill battle.

@DavidMtl For this to work you still need to have the launcher running, right?

Correct, it’s just the syntax to link to another safesite that is different between classic browsers (Chrome, Firefox, etc.) and SAFE Browser. This script just switches between them depending on which browser you use.

1 Like

Is it the plan that all safenet URLs will end with .safenet? I thought this is just temporary to ease a proxying mechanism.

I’d expect it’ll entirely rest on whether there is any crossover and optional mixed use allowed.

If SAFE is not accessible via clearnet links as http://safeurl, then pages including links to safe might as well be plaintext safe:// without teasing users.

The apparent push for SAFE to be isolated and only accessible through the SAFE browser, perhaps suggests initially that no interlinking will be possible except through apps. Which I wonder tempts a query whether http:// links should be disabled in SAFE browser.

I see no reason to disable http links, but there definitely needs to be a strict policy of no mixed clearnet and safenet usage on the same page. If the browser allows web developers to just inject google analytics into your safe pages, you lose all the benefits of safe. Suddenly you’re being tracked just as much, your sites just load a little more slowly and the website owners are paying less for their hosting. Clearly not desirable.


I also thought about that, but there will be needs to ease transition during adoption, e.g. I’m thinking that you could be controlling a website just partially, so you’ll need some ways to gradually transition, moreover we should help in providing options for such process.