Start a new topic

A “back” button in the site header

This may seem silly (after all, you can use the “back” button on your browser, right?) but if you run Cohost as a web app on something like an iPad (by adding a shortcut to it to your Home Screen and launching it from there), the standard Safari controls aren’t present.

I can just view Cohost as a Safari tab, of course, but it’s nice to have it run as its own app, without the Safari UI clutter.


8 people like this idea

I find the lack of a back button frustrating when using the Cohost mobile "app" (iOS, iPhone 11).  I don't typically use touchscreen gestures other than scrolling, so I didn't know until reading this feature request that 'swipe to go back' was even an option. I've tried to get the hang of it, but it rarely works on the first try, and I think a back button in the header bar would be helpful for those who are not very "gesture-savvy".

Signed up just to comment on this- I have this problem on my iPhone 13 (16.4.1 a) and it’s super annoying.

I didn't know about the swipe-to-go-back gesture, so when I first tried the progressive web app I didn't even think it was possible to go back. Even knowing about the gesture, I would prefer a button.

I use cohost as a PWA on both mobile and desktop.

Yeah the whole reason I would want it is mobile, on firefox on desktop I have a back button so it's wholly unnecessary. It's cool that you made it work, though!

Thanks! Unfortunately I usually browse on my iPad, but I’m sure this will be helpful for those browsing on their desktops.


1 person likes this

I just implemented a very basic back button myself.  If you install the Tampermonkey extension, you can use this script to put in the back button (and also set theme color)

// ==UserScript==

// @name Cohost PWA stuff

// @namespace https://cohost.org/

// @version 0.1

// @description try to take over the world!

// @author You

// @match https://cohost.org/*

// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==

// @grant none

// ==/UserScript==

(function() {

    'use strict';

    document.addEventListener('DOMContentLoaded', function(){

        var a = document.createElement('div');

        a.innerHTML = '<a class="text-text hover:text-accent" onclick="window.history.back()" style="font-weight: 900;">&lt; back</a>';

        document.querySelector("a[href='https://cohost.org/']").parentNode.prepend(a);

        console.log("cohost");

        document.querySelector("header").style="padding-left: 1em; padding-right: 1em;";

        var meta = document.createElement('meta');

        meta.name = "theme-color";

        meta.content = "#83254f";

        document.querySelector("head").append(meta);

    })

})();

image


 

 

 

Yes!! I was considering posting this. The swiping back mostly works but it's not as responsive as swiping on a native app often is. A back button would be very welcome.

Login or Signup to post a comment