basic gopher:// url view activity handling
This commit is contained in:
@@ -338,8 +338,17 @@ addEventListener('DOMContentLoaded', function() {
|
|||||||
//setup the theme
|
//setup the theme
|
||||||
updateTheme()
|
updateTheme()
|
||||||
|
|
||||||
// load the homepage if present
|
// load the homepage if present and we're not in an activity
|
||||||
var hp = getBookmark(0)
|
if(!location.hash) {
|
||||||
loadURL(hp || 'about:kopher')
|
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)
|
}, false)
|
||||||
|
|||||||
+15
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"name": "Kopher",
|
"name": "Kopher",
|
||||||
"description": "A Gopher client for KaiOS",
|
"description": "A Gopher client for KaiOS",
|
||||||
"launch_path": "/index.html",
|
"launch_path": "/index.html",
|
||||||
@@ -24,6 +24,20 @@
|
|||||||
"description": "To notify about downloaded files"
|
"description": "To notify about downloaded files"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"activities": {
|
||||||
|
"view": {
|
||||||
|
"href": "/index.html#ext",
|
||||||
|
"disposition": "window",
|
||||||
|
"filters": {
|
||||||
|
"type": "url",
|
||||||
|
"url": {
|
||||||
|
"required": true,
|
||||||
|
"pattern":"gopher:.{1,16384}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"returnValue": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"installs_allowed_from": [
|
"installs_allowed_from": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user