Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% set alt_l = alt %}
- {% set t = bag('versions', 'torbrowser-stable') %}
- {% set download_prefix = '/dist/torbrowser/' + t.version + '/' %}
- {% set version = t.version %}
- {% if alt_l == 'en' %}
- {% set alt_l = 'en-US' %}
- {% elif alt_l == 'es' %}
- {% set alt_l = 'es-ES' %}
- {% endif %}
- {% set a = bag('download-alternatives') %}
- <script> altData = []; </script>
- {% for id, item in bag('download-alternatives').items() %}
- <script>
- altData.push("{{id}}");
- </script>
- {% endfor %}
- <script type="text/javascript">
- var OSName = "Unknown OS";
- if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
- if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
- if (navigator.appVersion.indexOf("X11")!=-1) OSName="GNU";
- if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
- //console.log('Your OS is: '+OSName);
- // var download_prefix = $('#my-data').data('prefix');
- var download_prefix = '{{download_prefix|tojson}}';
- function detectLang() {
- if (navigator.languages != undefined) {
- return navigator.languages[0]
- }
- else {
- return navigator.language;
- }
- }
- var userLocale = detectLang();
- var userLocaleStripped = userLocale.split('-')[0];
- var filter = altData.filter(s => s.includes(userLocaleStripped));
- if (filter != undefined && filter.length > 0) {
- console.log("filter is defined");
- if (filter.length > 1) {
- var altLang = userLocale;
- }
- else {
- var altLang = userLocaleStripped;
- }
- }
- else {
- console.log("filter is undefined");
- var altLang = 'en-US';
- }
- console.log("userLocale is " + userLocale);
- console.log("userLocaleStripped is " + userLocaleStripped);
- console.log(altData);
- console.log("filter is " + filter);
- console.log("altLang is " + altLang);
- console.log("{{a.id}}");
- if (OSName == "Windows"){
- if (navigator.userAgent.indexOf("WOW64") != -1 ||
- navigator.userAgent.indexOf("Win64") != -1 ){
- alert("This is a 64 bit Windows OS");
- var arch = 'win64-';
- }
- else {
- var arch = '';
- }
- var download_link = "{{ download_prefix }}" + 'torbrowser-install-' + arch + "{{ version }}" + '_' + altLang + '.exe';
- var sig_link = download_link + '.asc';
- var label = "Download for Windows";
- var id = "fa-windows-png";
- }
- else if (OSName == "MacOS"){
- var download_link = "{{ download_prefix }}" + 'TorBrowser-' + "{{ version }}" + '-osx64' + '_' + altLang + '.dmg';
- var sig_link = download_link + '.asc';
- var label = "Download for OS X";
- var id = "fa-apple-png"
- }
- else {
- if (navigator.userAgent.indexOf("Linux x86_64") != -1 || navigator.userAgent.indexOf("Linux aarch64") != -1 || navigator.userAgent.indexOf("Linux armv8l") != -1){
- alert("This is a 64 bit Linux OS");
- var arch = 'linux64';
- }
- else {
- var arch = 'linux32'
- }
- var download_link = "{{ download_prefix }}" + 'tor-browser-linux64-' + arch + '-' + "{{ version }}" + '_' + altLang + '.tar.xz';
- var sig_link = download_link + '.asc';
- var label = "GNU/Linux"
- var id = "fa-linux-png"
- }
- console.log(download_link);
- console.log('download prefix is'+download_prefix);
- window.onload = function() {
- document.getElementById('downloadButton').innerHTML = label;
- document.getElementById("downloadIcon").classList.add(id);
- document.getElementById('downloadButton').href = 'https://www.torproject.org' + download_link;
- document.getElementById("downloadLink").href = 'https://www.torproject.org' + download_link;
- document.getElementById("sigLink").href = 'https://www.torproject.org' + sig_link;
- }
- </script>
- <div class="row">
- <h1 class="mx-auto display-2 text-white text-center">{{ _('Defend yourself.') }}</h1>
- </div>
- <div class="row">
- <h3 class="mx-auto defend text-white text-center">{{ _('Protect yourself against tracking, surveillance, and censorship.') }}</h3>
- </div>
- <div class="row p-5 mx-auto">
- <div style="margin:auto">
- <div class="oval-2 bg-darker">
- <a class="downloadLink" id="downloadLink" href="">
- <i class="text-light fab" id="downloadIcon"></i>
- </a>
- <a class="downloadLink btn btn-primary mt-4" id="downloadButton" href=""></a>
- <a class="link" id="sigLink" href="" download><span class="nick text-white">{{ _('Signature') }}</span></a>
- <a class="link" href="{{ 'https://support.torproject.org/' + this.alt + '/tbb/how-to-verify-signature/' }}" target="_blank"><i style="font-size:10px;" class="text-light fas fa-question-circle"></i></a>
- </div>
- </div>
- </div>
- <!--
- <div class="col-sm-6 col-md-3 py-3">
- <div class="oval-2 bg-darker mx-auto">
- <a href="#android">
- <i class="text-light fab fa-android-png"></i>
- </a>
- <a class="btn btn-primary mt-4" href="#android">{{ _('Download for Android') }}</a>
- </div>
- </div>
- -->
- <div class="row p-5">
- <a class="mx-auto text-white py-3 text-center" href="{{ 'languages'|url(alt=this.alt) }}"><u>{{ _('Download in another language or platform') }}</u></a>
- <a class="mx-auto text-white py-3 text-center" href="{{ 'alpha'|url(alt=this.alt) }}"><u>{{ _('Download the latest alpha build') }}</u></a>
- <a class="mx-auto text-white py-3 text-center" href="{{ 'tor'|url(alt=this.alt) }}"><u>{{ _('Download Tor Source Code') }}</u></a>
- </div>
- <div class="row bg-darker my-5 p-3 rounded">
- {% from "macros/downloads.html" import render_tor_browser_blog_post %}
- <h5 class="mx-auto text-white text-center my-0"><i class="text-light fas fa-exclamation-circle text-warning px-2"></i>{{ _('Android Tor Browser 10 is under active development. Watch for its release in the coming weeks.') }}</h5>
- </div>
- <div class="hidden-sm row p-md-5 justify-content-center window-bg">
- <a class="mx-auto text-white text-center py-md-5" href="https://blog.torproject.org/category/tags/tor-browser"><u>{{ _('Read the latest release announcements') }}</u></a>
- </div>
Add Comment
Please, Sign In to add comment