1. 45
  1.  

    1. 11

      The SIGUSR1 signal now causes the current page to be reloaded. This is useful to implement a live view while editing a web page.

      This is cool.

      1. 1

        Yeah, this is what got my attention too, it looks cool, but at the same time, it isn’t that unique - it is easy to do with a short javascript snippet in other browsers too.

        1. 1

          But don’t you need long polling or websockets then? Surely the browser can only know to reload if the server tells it to?

          1. 2

            Yes, but that’s not a problem, it is a few lines of javascript. websockets and event sources can both connect to localhost too so it doesn’t have to be the server per se, it can be some other little command forwarder - including one that responds to SIGUSR1 if you want, though I think signals are a pain in the butt and I’d rather just use a directory watcher in the code itself. Of course, you could also set up something with ui automation to hit the refresh button on the browser too.

            It takes like a couple lines of generic javascript and a dozen or two lines of D (or surely similar in your language of choice) to make it happen.

            So yeah, nice that dillo has it built in now but not really new or unique. Alternatively, you can put a page on a meta refresh timer of a few seconds and just constantly be reloading so any time you glance over at it, it will be pretty recent, though this is a pain in its own way.

            Here, I’ll show you right here how I might do it:

            // paste this in your site while you work on it
            var es = new EventSource("http://localhost:2299/");
            es.addEventListener("refresh", function() { location.reload(); });
            

            the JS is legit that simple. The actual watcher is a lil more involved but really not bad.

            shared static this() {
                  // need a thread cuz of a quirk of my library, on my list to fix this
                  // but haven't gotten around to it yet
                    import core.thread;
                    new Thread(() {
                            import arsd.core;
                           // the files you listen to could be passed from the cmd line or something instead
                            auto dw = new DirectoryWatcher(FilePath("/var/www/htdocs"), "reloader.html", false, (mod, op) {
                                    EventSourceServer.sendEvent("reloader", "refresh", "{}", 0);
                            });
            
                            getThisThreadEventLoop().run(() => false);
                    }).start;
            
            }
            
            import arsd.cgi;
            void handler(Cgi cgi) {
                // need to allow cross-domain things for the EventSource to pull from localhost
                    cgi.setResponseHeader("Access-Control-Allow-Origin: *");
                    cgi.setResponseHeader("Access-Control-Allow-Methods: GET");
                    if(cgi.requestMethod == Cgi.RequestMethod.GET) {
                            EventSourceServer.adoptConnection(cgi, "reloader");
                    }
            }
            mixin GenericMain!handler;
            
            

            Even working around the quirks in my library, this isn’t a lot of code, and I expect Go, Node, and other popular things can do it similarly shortly.

            Again, I think Dillo’s new feature is cool, and composing it with other shell commands is a neat trick, but the functionality itself isn’t game changing.

            1. 1

              Very thorough reply, thank you.

          2. 1

            Yeah, it’s not unique, but I think it is novel for low-overhead browsers that don’t implement JavaScript. Obviously not a common use case, but I use Dillo and w3m on some vintage computers because modern browsers use up all my memory.

        2. 7

          I’m always happy to see updates to one of the few browsers that’ll still run decently on m68k machines :)

          1. 3

            one of the few browsers that’ll still run decently on m68k machines

            +1

            Especially ironic as WorldWideWeb was designed and implemented on a 68030 box, of course.

            1. 3

              What other browsers run decently on there?

              1. 3

                IBrowse under AmigaOS runs quite well, even on an ‘030, and NetSurf should run adequately, although it has been a long time since I’ve tried it.

            2. 7

              Using browsers like these during your front-end development will easily help you keep tabs on the state of your pogressive enhancement. Dillo users aren’t expecting perfection with styles, but a you can make sure your content is at least navigable.

              1. 4

                I find it a bit ironic that this is currently number 2 right below a post about a tool to block ai scrapers that would make dillo and other minimal browsers not work. I really love the idea of using and supporting minimal browsers but also love the idea of preventing ai crawlers. Is there any middle ground to be found? Anybody think they have a good solution for this running?

                1. 4

                  I think you are referring to Anubis which only triggers its challenge for user agents claiming to be “Mozilla”, which Dillo does not.

                  1. 1

                    I’ve done some testing, to see which minimal browsers have Mozilla in the UA and can’t past the test:

                    Browsers that don’t have Mozilla, and thus get through: Dillo, lynx, links, elinks

                    Browsers that can’t get through anubis without modifying their user agent: chawan, netsurf

                    There’s also Versara currently on the lobsters front page, and it doesn’t seem to work with any of those browsers, since it requires both sufficiently good css and javascript support.

                2. 2

                  What does Dillo support and what doesn’t it?

                  1. 3

                    From the Dillo User Manual:

                    “Dillo supports a subset of HTML 4.01 and CSS 2.1 but it doesn’t support JavaScript and only implements some elements of HTML 5 and CSS 3. It also renders plain text documents and images in PNG, JPG, GIF, SVG and WebP formats.”

                  2. 1

                    I like the idea of a “paged” view. Of all things, Windows 8 had a horizontally paging view and I liked reading with that instead of the infinite vertical scrolling of browsers (usually with tons of empty space on either side of one column of text).

                    1. 2

                      It sounds pretty similar to the old XWindows Athena widget set - scrollbars in that would scroll down on a left click, and scroll up on a right click. But it wasn’t scrolling by a page, but by an amount relative to where the mouse was on the scrollbar (so you could “configure” the overlap amount simply by mouse position. Middle-click would move the scrollbar as an absolute.

                      NeXT otoh from memory, did per-line scrolling with the scrollbar arrows (back when that was a thing!), and per-page scrolling on right click of the arrows.

                      I wouldn’t mind this scrollbar paradigm to become more common again