News for hackers. Stuff that matters.
Re:Progressive Apps: Escaping Tabs Without Losing Our Soul by untog on Tuesday June 16, 2015 @10:54AM (#9726216)
Oh absolutely. I think this is a huge step forward - I'm mostly just moaning at a lack of cross-platform compatibility in a situation where it would be a huge deal.

What was the rationale for not having a document.addToHomescreen() function? I can see it being open to abuse, but not any more or less than pop-up windows (especially when limited to only being called within touch events and so on)

Re:Progressive Apps: Escaping Tabs Without Losing Our Soul by slightlyoff on Tuesday June 16, 2015 @01:53PM (#9727561)
The abuse considerations were what led us to implement the engagement check. An API for this would absolutely be spammy.

If everyone is going to be calling it on every page-load, and if the browser is (predictably) not going to allow that to show every time (see window.open()), then why provide an API when we could just treat meeting the criteria we'd look for anyway as the same thing as calling such an API?

That's what the Chrome system does: you've implicitly called "addToHomescreen()" on every page load where your app meets the criteria. When we allow it to show is still mediated by the browser.

Chrome 44 is going to allow a measure of control: http://updates.html5rocks.com/2015/03/increasing-engagement-...

The event is cancelable, meaning that if you don't want it to show on a particular page, it'll trigger again on the next. We'll also be adding a way for you to delay the load; cancel and re-trigger inside the same page. The way to think about it is that you sometimes get a golden ticket. We'll give you the ability to spend it when you want in the near future, but making you do an API call when the intent is already clear just seemed like bad design.