Live data from Hacker News

Tiny PWAs and why I keep building them

justinribeiro.com

121–130 of 178 posts

Re: Tiny PWAs and why I keep building them

#121
post #79

Earlier quoted context omitted.

Upload? Come on, just load it as dataURI, bookmark it and you have offline "application" at your disposal. And as a bonus, here, have this "distributed app store" you can even print on paper [1]. [1] http://zxing.org/w/chart?cht=qr&chs=350x350&chld=L&choe=UTF-... i.e. QR-coded dataURI document data:text/html;charset=utf-8, Screen light

My iPhone 6s doesn’t like this QR code, it just says “No usable data found”.

The built-in QR detector is very finnicky/odd, apparently it just assumes every payload is an HTTP URL, nothing else works even remotely.

Other applications work much better for that, though they may or may not recognise non-http URIs e.g. here scanbot just displays the textual content and you're on the hook for copy/pasting it wherever you need.

Re: Tiny PWAs and why I keep building them

#122

Earlier quoted context omitted.

My iPhone 6s doesn’t like this QR code, it just says “No usable data found”.

is there a "don't try to use the data" setting, so it'll just present the plain text?

Nope. Only setting is to not scan for qrcodes at all.

Re: Tiny PWAs and why I keep building them

#123
post #107

Earlier quoted context omitted.

Why don't browsers give us finer control over Javascript execution (eg whitelisting JS APIs)? Performance?

Because it would work like permissions on Android or Windows UAC, regular users would just turn everything on anyway.

Maybe.

On Android, iOS, Firefox extensions, and many websites, you can't give permission for one thing without giving permission for everything. Or those "I accept cookies popups" -- until recently, you couldn't choose which cookies you wanted to accept, so either you accept tracking cookies in order to use basic functionality, or you head elsewhere. The application developer could be a good citizen and request on the permissions needed -- but it's just easier to request that they be able to read and modify any and all data, regardless of their need or desire to do so.

On Windows, Unix, and other "system-level" permission systems, you have a different problem. There, there is no real ability to verify what an application is trying to do with its elevated permissions -- it just wants to be given God power, even if it only needs permission to do one or two very specific things in one or two very specific locations.

In fact, the web browser is probably the most accessible place to roll out a whitelisting-based permission system. It has already been demonstrated successfully with uBlock Matrix and uBlock Origin -- you can block specific types of activity coming from specific subdomains. Some sites break completely when you block the few specific elements you don't want to see, but most work just fine, or at least close to fine. Being able to whitelist specific Javascript APIs (e.g. the battery API, the ambient light API, etc) is a logical next step in my opinion.

An OS-level analogy would be the ability to block specific syscalls made by specific processes, optionally only when spawned by a specific parent process.

Re: Tiny PWAs and why I keep building them

#124
post #71

Holy crap it's scary that he's building his own speedometer like that. GPS based speedos aren't all that accurate. Ballpark, sure, but not accurate. There are also many circumstances under which GPS won't work. In many countries a car without a functional speedometer is not allowed on the road, for safety reasons.

I'd expect it to be better than the car speedo. Car speedos typically overread by up to 10%, and if you fit a non-standard tyre, they can be way off.

I might have this wrong, but I seem to recall reading somewhere that speedos in the EU have to overread by some random amount, with the aim of curbing speeding.

Re: Tiny PWAs and why I keep building them

#125

Earlier quoted context omitted.

Viewing the source of the reading light and speedometer reveals that both include google analytics tracking code.

Where do you see the google analytics code in the speedometer? It's true that the site his example is running on includes GA, but I can't see anything in the source other than a reference to an analytics build which uses a file that only exists if you choose to create it.

The HTML includes this:

    
    window.ga = window.ga || ((...args) => (ga.q = ga.q || []).push(args));ga('create', 'UA-130560367-1', 'auto');ga('set', 'transport', 'beacon');ga('set', 'anonymizeIp', true);ga('send', 'pageview');
The network pane in my browser, when disabling ublock, looks like this: https://s.mort.coffee/d/img/scr-2019-02-03-74462.png

Re: Tiny PWAs and why I keep building them

#127

There are only two real things limiting PWAs in my opinion: 1. Lack of support on iOS. I presume it’ll stay this way for a while (years!). Mobile Safari finally has service workers, but really, that’s about it. No support for “Add to Home Screen” (technically it’s there, but doesn’t work the way it does in other browsers), and a lot of other APIs. 2. The Web is missing some APIs that would really let it compete with…

For 2, this is the one I'm most looking forward to: https://developers.google.com/web/updates/2018/11/writable-f...

Entire classes of PWAs are essentially impossible to build right now because of the lack of ability to work with files directly, think offline editors, offline music players, etc.

Re: Tiny PWAs and why I keep building them

#128

There are only two real things limiting PWAs in my opinion: 1. Lack of support on iOS. I presume it’ll stay this way for a while (years!). Mobile Safari finally has service workers, but really, that’s about it. No support for “Add to Home Screen” (technically it’s there, but doesn’t work the way it does in other browsers), and a lot of other APIs. 2. The Web is missing some APIs that would really let it compete with…

I am very happy that the web has no more APIs. I'm already tired enough of telling my browser that I don't want any website to send me notifications, to access my location, to access my camera, my microphone. And God knows what goes behind my back. Enough is enough!

That is because of bad usability of the browsers, though.

Default should be for example some icon indicating that the website wants more permission ... and then if I feel like it, I grant more permission. Til the point of fully trusting and giving all access.

But a website is a website I just read and will never get more permissions from me. But a pwa ... like a game, I would grant more permissions. This is something that should be made easy from the browser to choose, whithout getting annoyed by permission popups all the time.

Re: Tiny PWAs and why I keep building them

#129

Earlier quoted context omitted.

I am very happy that the web has no more APIs. I'm already tired enough of telling my browser that I don't want any website to send me notifications, to access my location, to access my camera, my microphone. And God knows what goes behind my back. Enough is enough!

That is because of bad usability of the browsers, though. Default should be for example some icon indicating that the website wants more permission ... and then if I feel like it, I grant more permission. Til the point of fully trusting and giving all access. But a website is a website I just read and will never get more permissions from me. But a pwa ... like a game, I would grant more permissions. This is something…

Isn't this usability issue on part of the website developer/ux designer too? What you point out is right, but it can also be implemented in a way where you're not outright just calling the function to pop up that little notification asking for [insert api] permission. It might be a better solution where the ux designer/developer has some sort of button the website that then calls that function for a slightly better experience.

Re: Tiny PWAs and why I keep building them

#130
post #71

Holy crap it's scary that he's building his own speedometer like that. GPS based speedos aren't all that accurate. Ballpark, sure, but not accurate. There are also many circumstances under which GPS won't work. In many countries a car without a functional speedometer is not allowed on the road, for safety reasons.

I'd expect it to be better than the car speedo. Car speedos typically overread by up to 10%, and if you fit a non-standard tyre, they can be way off.

Soeedometers perform the most precise measurement you can get. When you fit a nonstandard tire you just introduce a constant scaling factor. That is not so bad. GPS on the other hand is atrocious. Don't even try to get an accurate position in places like downtown Seattle. I'm regularly getting misplaces by several blocks because of occlusion and reflections from the buildings. You just can't compute an accurate speed from such a signal.

Besides, GPS can only update once a second. And given the signal jitter you can't get a good speed reading from the last two fixes - when you are going in a straight line. When you are not going straight, the GPS based estimate must underestimate the distance you travelled and thus your speed.

Using this toy speedometer thingy for driving is just dangerous and insane and illegal in so many ways that I wish the article could just be pulled from the web.

Post reply on HN