This commit is contained in:
Luxferre
2023-04-03 20:03:08 +03:00
parent 1a3e5e06dd
commit df5d21e2d4
3 changed files with 7 additions and 11 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ All these limitations are intended to keep Kopher's codebase simple, and not lik
## How does Kopher integrate with the rest of KaiOS?
It almost doesn't. But, whatever could be done without hacks, has been done since the version 0.0.6. First, you can share the current URL (in the `gopher://` format) using Bluetooth/Messages/Email share menu (if you select Bluetooth or any other provider that requires blobs, it gets sent as a vCard 2.1 file with the `N` and `URL` fields set to the same value) by pressing `*` and Call key. Second, Kopher itself registers a `view` activity handler for every URL that starts with `gopher:`. If you just updated Kopher to version 0.0.6, you need to reboot your phone for this feature to start working. For some reason, `gopher:` URLs still aren't picked up by the stock KaiOS browser or the `window.open()` call, but any other application that sends URLs to the `view` activity according to the spec should be able to open `gopher://` URLs in Kopher.
It almost doesn't. But, whatever could be done without hacks, has been done since the version 0.0.6. First, you can share the current URL (in the `gopher://` format) using Bluetooth/Messages/Email share menu (if you select Bluetooth or any other provider that requires blobs, it gets sent as a vCard 2.1 file with the `N` and `URL` fields set to the same value) by pressing `*` and Call key. Second, Kopher itself registers a `view` activity handler for every URL that starts with `gopher:`. If you just updated Kopher to version 0.0.6, you need to reboot your phone for this feature to start working. In the current state of KaiOS, `gopher:` URLs aren't picked up and translated into proper activities by the stock KaiOS browser or the `window.open()` call, but any other application that sends URLs to the `view` activity according to the spec should be able to open `gopher://` URLs in Kopher.
## Can I use the hi01379.js library in non-KaiOS environments?
+3 -7
View File
@@ -77,7 +77,7 @@ addEventListener('DOMContentLoaded', function() {
statusBar = document.querySelector('footer div.status'),
themeKey = 'uitheme', bookmarkKey = 'bookmarks', bkNumber,
history = [], historyIndex = 0, linkIndex = 0,
verticalScrollStep = 20, horizontalScrollStep = 20,
verticalScrollStep = 40, horizontalScrollStep = 20,
buf = '', emptyBk = '["","","","","","","","","","",""]'
function getTheme() {
@@ -338,17 +338,13 @@ addEventListener('DOMContentLoaded', function() {
//setup the theme
updateTheme()
// load the homepage if present and we're not in an activity
if(!location.hash) {
// load the default homepage
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)
+1 -1
View File
@@ -26,7 +26,7 @@
},
"activities": {
"view": {
"href": "/index.html#ext",
"href": "/index.html",
"disposition": "window",
"filters": {
"type": "url",