kopher

A simple Gopher client for KaiOS
git clone git://git.luxferre.top/kopher.git
Log | Files | Refs | README | LICENSE

commit df5d21e2d46996afb6789eb8d60cd9cf048a74fe
parent 1a3e5e06dd97f336a8dd19b4e6834e803ff270c5
Author: Luxferre <lux@ferre>
Date:   Mon,  3 Apr 2023 20:03:08 +0300

v0.0.6

Diffstat:
MREADME.md | 2+-
Mjs/app.js | 14+++++---------
Mmanifest.webapp | 2+-
3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md @@ -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? diff --git a/js/app.js b/js/app.js @@ -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) { - var hp = getBookmark(0) - loadURL(hp || 'about:kopher') - } + // 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) diff --git a/manifest.webapp b/manifest.webapp @@ -26,7 +26,7 @@ }, "activities": { "view": { - "href": "/index.html#ext", + "href": "/index.html", "disposition": "window", "filters": { "type": "url",