From 00cd1ed0a60532ad9a68d8a3a13fee58f00235ca Mon Sep 17 00:00:00 2001 From: Luxferre Date: Mon, 3 Apr 2023 13:16:08 +0300 Subject: [PATCH] Fixed shared URL representation --- js/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 24a8e2f..4e518a7 100644 --- a/js/app.js +++ b/js/app.js @@ -16,6 +16,7 @@ function saveBlob(blob, fname, successCb, errorCb) { } function hi2gopher(hiurl) { + if(!hiurl.startsWith('hi:')) return hiurl var parts = hiurl.split(':')[1].split('|') return 'gopher://'+parts[2]+':'+parts[3]+'/'+parts[0]+parts[1] } @@ -108,7 +109,7 @@ addEventListener('DOMContentLoaded', function() { function loadURL(url, noNavUpdate) { // wrapper to openURL that actually updates all the UI and history logoStatus.textContent = logoLoadingChar - statusBar.textContent = 'Loading ' + url + statusBar.textContent = 'Loading ' + hi2gopher(url) openURL(url, function(res) { // success callback logoStatus.textContent = logoDefaultChar statusBar.textContent = '' @@ -314,7 +315,7 @@ addEventListener('DOMContentLoaded', function() { navigator.mozApps.getSelf().then(function(app) { var mfst = app.manifest var aboutText = mfst.name + ' v' + mfst.version + ' by ' + mfst.developer.name - aboutText += '\nPage: ' + currentUrl + aboutText += '\nPage: ' + hi2gopher(currentUrl) alert(aboutText) }) break