basic gopher:// url view activity handling

This commit is contained in:
Luxferre
2023-04-03 15:24:05 +03:00
parent 23598e0e62
commit e60c71085c
2 changed files with 27 additions and 4 deletions
+12 -3
View File
@@ -338,8 +338,17 @@ addEventListener('DOMContentLoaded', function() {
//setup the theme
updateTheme()
// load the homepage if present
var hp = getBookmark(0)
loadURL(hp || 'about:kopher')
// load the homepage if present and we're not in an activity
if(!location.hash) {
var hp = getBookmark(0)
loadURL(hp || 'about:kopher')
}
// set external activity handling for gopher:// URLs
navigator.mozSetMessageHandler('activity', function(req) {
var act = req.source
if(act.name === 'view' && act.data.type === 'url' && act.data.url)
loadURL((''+act.data.url) || 'about:kopher')
});
}, false)