Live data from Hacker News

The Mobile Web should just work for everyone

blogs.msdn.com

71–80 of 127 posts

Re: The Mobile Web should just work for everyone

#71

How exactly is the mobile web biased towards iOS? I've rarely (if ever) had to use a vendor prefix when developing for mobile. I am using Bootstrap, so maybe they're doing those for me.

Because some websites use user agents to determine whether or not to serve a website optimized towards modern mobile devices, and some of those user agent sniffers are only looking for Mobile Safari. If you aren't Mobile Safari or claiming to be, you either get the desktop site or the ancient mobile site designed for feature phones.

Re: The Mobile Web should just work for everyone

#72

"In general, our advice is to develop a responsive site that can adapt to the capabilities of different devices. If you choose to build a mobile-specific experience then we recommend looking for the sub-string "mobile" in the user agent string to determine when to deliver mobile optimised content:" function isMobile() { return navigator.userAgent.toLowerCase().indexOf("mobile")>=0; } This is really the best we can do…

or do user-agent detection server-side against database of (mostly) known user-agents and take JS out of the UA detection picture entirely.

In JVM land I've had pretty good success with UADetector [1] for delivering device specific content to mobile phones and desktop/laptop/tablets.

[1] https://github.com/before/uadetector

Re: The Mobile Web should just work for everyone

#73
I think the Windows Phone team deserve some credit for doing this, knowing that the developer reaction to it will be deeply negative (read: most comments in this thread).

The simple fact is that it works better for Windows Phone users. If developers hadn't been using webkit-prefixed CSS everywhere it wouldn't be an issue, but it is.

That said, I wish Windows Phone IE had better developer tools. Both Android and iOS let you plug your phone in via USB and access the web console. It's great.

Re: The Mobile Web should just work for everyone

#74
Firefox OS is dealing with similar compromises with homescreen site icons and the apple touch icons.

https://bugzilla.mozilla.org/show_bug.cgi?id=921014

Even though sites should be using the standards version the Apple one is still very popular. If you decide not to support it, users just think your OS / Browser looks like crap. It's a tough spot to be, especially considering that its financially in Apple's best interest to break the web.

EDIT: Linked to wrong bug

Re: The Mobile Web should just work for everyone

#75
post #51

Edit: The previous title was "Windows Phone's IE starts masquerading as mobile Safari to render pages properly" Looks like the webkit prefix tags are creating the new IE6. As usual, it's the web developers fault for not updating their CSS prefixes. http://css.dzone.com/articles/why-webkit-new-ie6-trap-vendor Mozilla, Opera and Microsoft have been complaining about this and Opera had already implemented support for th…

> Looks like the webkit prefix tags are creating the new IE6. This bothers me. Webkit isn't some ancient browser that is has remained stagnant for years until google/apple decided to do something about it. Nobody spends hours debugging their perfect layouts in webkit. Webkit isn't holding the entire web back. It's just a poor comparison. I browse mobile web in mostly firefox mobile, and I don't think I've ever seen a…

Most of my professional time these days is spent on mobile/tablet websites for a major automobile manufacturer. And there are days when we absolutely do obsess over layout and other issues introduced by mobile safari itself. On the release of iOS 7, we actually probably burned a month working with a bug that we never found a solution to (which, fortunately, was fixed with iOS 7.1).

That last part underscores that we're fortunate browser makers are issuing regular updates (a big difference from IE). On the other hand, with some of those updates come new bugs and (particularly on Android) fragmentation. Consider that by 2006 there were enough people/resources documenting IE6's quirks that it was pretty rare to run across a bug that someone didn't have a good idea of how to fix/workaround. In 2014 when you run across a mobile bug (particularly one from a recent release, of which there are many), it may well be that nobody knows how to solve your problem, and in some cases nobody seems to even know how to tell you to duplicate it across devices/emulators (http://stackoverflow.com/questions/23142762/how-to-identify-... ).

And of course, like IE, many developers code webkit-only, even iOS only (and I know why: at the level of ambition people often have for mobile websites and with the difficulty involved in testing more than a few devices, it can sometimes seem like the only way to get things out the door).

IE6 was no picnic, but there are times I think to myself I'd rather be working on the 2006 desktop web than the 2014 mobile web....

Re: The Mobile Web should just work for everyone

#76
post #56

Why do you need to detect if mobile? Why aren't media queries enough?

Because a ton of people ~5 years ago decided to do entirely separate mobile sites instead of responsive designs and we have now ended up with the mess everyone said we'd end up with.

Re: The Mobile Web should just work for everyone

#77
post #20

So the history of every user agent string ever repeats itself. And they get longer and longer. And we've created a horrible horrible mess. Ever notice everyone identifies as Mozilla first? http://webaim.org/blog/user-agent-string-history/

Yep, it's a browser vendor's reaction to a developer-tilted monoculture. On repeat.

On the plus side, User agent strings are moving closer to being useless as conditional branches for features. Hopefully, vendor-prefixes won't be far behind.

I guess developers just don't grok abstractions when it comes to the Web. They know their preferred browser, but somehow fall short of abstracting their development to "work on the Web" rather than "Works best in Chrome on an iPhone 5S."

Re: The Mobile Web should just work for everyone

#79

Firefox OS is dealing with similar compromises with homescreen site icons and the apple touch icons. https://bugzilla.mozilla.org/show_bug.cgi?id=921014 Even though sites should be using the standards version the Apple one is still very popular. If you decide not to support it, users just think your OS / Browser looks like crap. It's a tough spot to be, especially considering that its financially in Apple's best inte…

And that is exactly why web-standards are so important. It's always in a broswer's best interest to break the web.

Re: The Mobile Web should just work for everyone

#80
This is just another reason why all browsers (not just mobile) should be reporting their screen size. As in, the actual height/width. Not pixels. Pixels lie and so do browsers, actually.

If I knew that the user's browser was 3 inches wide I could choose a point-based font size that's appropriate. It would also be trivially easy to scale font and image sizes up or down based on that knowledge. Especially if I'm using SVG.

72pt is precisely 1 inch tall (width is variable). However, if I set a font to 72pt we'll see that almost all browsers get it wrong. They are hard-coded to assume that the user's display is 96dpi or even worse (in the case of Apple devices) it simply pretends that the device is some fixed pixel width when it isn't (i.e. retina displays).

Did you know that the CSS spec has 'in' and 'mm' as size options? Yet when you set the font-size to '1in' you will almost never get a font that is one inch tall because the browser is hard-coded to assume that the user's display is 96dpi. It drives me crazy and it will only get worse over time as we get a larger variety of devices.

We need to stop the madness (that was introduced by Apple with the pretend-the-screen-has-this-many-pixels nonsense) and switch to accurate screen size/dpi reporting. Anything else is doomed to crap like what's mentioned in this article.

Post reply on HN