News for hackers. Stuff that matters.
Re:Tiny PWAs and why I keep building them by megous on Sunday February 03, 2019 @08:36AM (#19069487)
Exactly. If more people's reaction, instead of searching an app store for a privacy respecting screen light, was to sit down and write:

    <!DOCTYPE html>
    <script>let on  true;</script>
    <body onclick="on = !on; this.style.background = on ? 'white' : 'black'">
and were able to easily upload it somewhere on a phone and run it locally from a shortcut on the screen. We'd have hacker culture encouraged right there.
Re:Tiny PWAs and why I keep building them by myfonj on Sunday February 03, 2019 @11:17AM (#19070399)
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,<!DOCTYPE html><title>Screen light</title><html onclick=on=!on;this.style.background=on%3F'white':'black'><body onload=on=true>
Re:Tiny PWAs and why I keep building them by t0astbread on Sunday February 03, 2019 @06:47PM (#19072965)
This is great! I added some text to it to make it more "user friendly" and compressed it a bit so that it fits inside a tweet: https://mobile.twitter.com/T0astBread/status/109220433722755...

  data:text/html,<title>Screen Light</title><html onclick=o=!o;style.background=o%3F0:'black';style.color=o%3F0:'white'><body onload=o=1><h1>Screen Light</h1><p>Turn your screen into a light source<br>Tap to toggle<p><a href=https:/news.ycombinator.com/item?id=19069487>Source
Re:Tiny PWAs and why I keep building them by myfonj on Tuesday February 05, 2019 @01:21PM (#19088044)
Yes, such "offline bookmarked dataURI applications" are great, underappreciated and ancient things. Sadly, current trend in modern browsers is to suppress them in sake of security, because in the past some crooks misused them them. Currently you cannot even link to them like you could in the past; anything other than direct navigation from bookmark or URLbar results in better case in blank screen, in worse is silently blocked. For example in the past you could redirect to them, or make datauri editor that encoded itself into another datauri, or both [1], but now you can not [2].

[0] Check out for example this HTML / SVG sketchbook: https://gist.github.com/myfonj/c8ce74bf549e19600026ce9022388... [1] http://tinyurl.com/selcoditor (see network log) [2] https://blog.mozilla.org/security/2017/11/27/blocking-top-le...

Re:Tiny PWAs and why I keep building them by jahewson on Sunday February 03, 2019 @01:21PM (#19071230)
My iPhone 6s doesn’t like this QR code, it just says “No usable data found”.
Re:Tiny PWAs and why I keep building them by masklinn on Sunday February 03, 2019 @02:23PM (#19071581)
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 by myfonj on Tuesday February 05, 2019 @01:30PM (#19088171)
Yes, I had no luck even with QR reader integrated in Nightly Android [0].

Sadly, copypasting resulting URI as plaintext is most probably the only option for modern browsers, because any other way of top level frame navigation to dataURI document is blocked. (Besides existing bookmark, that is.) I keep forgetting this, sorry for hurried "in theory it must work great" shout out.

[0] https://support.mozilla.org/en-US/kb/scan-qr-codes-firefox-a...

Re:Tiny PWAs and why I keep building them by rhizome on Sunday February 03, 2019 @02:21PM (#19071572)
is there a "don't try to use the data" setting, so it'll just present the plain text?
Re:Tiny PWAs and why I keep building them by masklinn on Sunday February 03, 2019 @02:25PM (#19071600)
Nope. Only setting is to not scan for qrcodes at all.
Re:Tiny PWAs and why I keep building them by eat_veggies on Sunday February 03, 2019 @09:28AM (#19069695)
I'd love that but I don't think it'll encourage hacker culture. Instead we'll have the Can-Code making things for the Can't-Code like we do now, but with even fewer checks for nefarious activity.

Case study: people copy-pasting random code into their Myspace profiles

Re:Tiny PWAs and why I keep building them by acct1771 on Sunday February 03, 2019 @10:38AM (#19070117)
Inspired a lot of "can kinda read code"s to learn more - so they didn't get their pages compromised, haha
Re:Tiny PWAs and why I keep building them by lazerwalker on Sunday February 03, 2019 @09:40AM (#19069769)
I wonder if https://glitch.com has a mobile-friendly IDE and will also let you set up a project to be a PWA? Seems like it'd be a great fit for what you're describing.
Re:Tiny PWAs and why I keep building them by jt2190 on Sunday February 03, 2019 @10:38AM (#19070118)
Hmm... When I pulled up one of my Glitch projects on my iPhone Xs the browser-based editor works but the editor view is either cut off on the right in portrait mode or almost offscreen when the keyboard displays in landscape mode.

I suspect you can get a better coding experience by connecting your Glitch account to Github and then using an editor that works well on your device.

The PWA part of Glitch is completely under your control.

Re:Tiny PWAs and why I keep building them by adrianhel on Sunday February 03, 2019 @09:25AM (#19069678)
You can do that with mobile-web-app-capable and add to home screen on both ios and Android. No address bar and it looks like any other app. You need to host the site though.
Re:Tiny PWAs and why I keep building them by megous on Tuesday February 05, 2019 @10:08AM (#19085887)
Running it from file:/// of the phone's local filesystem could be more hassle-free. Not sure if it would be bookmarkable, but I don't see why not. I don't have access to a smartphone to try.
Re:Tiny PWAs and why I keep building them by natch on Sunday February 03, 2019 @11:54AM (#19070640)
You can already do this. You just need a site to host it on.