Show HN: Detect which iOS devices are used on your site(dieulot.fr)
dieulot.fr
Show HN: Detect which iOS devices are used on your site
https://www.dieulot.fr/idevice
40 comments
I recently wondered how the "Login alert for Mobile Safari on Apple iPhone 7 Plus"-email from Facebook could tell my what device I used to log in to the html version of Facebook. They must be doing the same correlation between SOC and screen size that is mentioned in the article.
Nice, could be useful when I’m trying to answer someones questions about their phone remotely and they don’t know which one they have.
Definitely!
I also use https://www.whatismybrowser.com for that kind of thing too.
I also use https://www.whatismybrowser.com for that kind of thing too.
But realistically speaking, ad networks are going to add this to their code to gather even more information about you.
To be honest, it would surprise me if they are not already doing this.
On a side note, when you install, launch and maximize TOR browser, you get a warning advising you not to maximize it. Web servers/attackers can use max screen size as an additional point to determine your identity.
On a side note, when you install, launch and maximize TOR browser, you get a warning advising you not to maximize it. Web servers/attackers can use max screen size as an additional point to determine your identity.
That’s confusing. Wouldn’t it be better if everyone maximised their window? If you have a random window size you have a much higher chance of it being unique.
The default TOR viewport size isn't random. It picks a multiple of 200x100, with 1000x1000 as the maximum
I think the idea is preventing tracking a user between different Tor Browser sessions, not within the same session. When Tor Browser opens, it opens at a default size, regardless of computer. So there's no way to differentiate between different Tor Browser users who don't manually change the window size.
If your screen resolution is common, it's just a bit or two worth of information. But enough of those bits from various sources and you are unique.
> If you have a random window size you have a much higher chance of it being unique.
That's the whole point, multiple unique data points can whittle down the differences to a single user.
That's the whole point, multiple unique data points can whittle down the differences to a single user.
Maybe? Probably not that useful for most ads. Unless you’re selling phone cases, iPhone 8 and XS users are probably getting the same ads.
Not device-type, looks famous.co can infer battery mode from Safari: https://imgur.com/a/XvAGvWS
They’re trying to autoplay a video, which Safari blocks if the device is in low power mode. https://pastebin.com/xxN2VPi4 Nice find!
pretty neat. what would be the best way for me to block this
Probably disabling JavaScript. That worked for me.
Would also recommend you file a bug at https://bugreport.apple.com.
This is linked directly to their internal bug tracker (Radar) so I can assure you it will be read and triaged by an engineering or product manager.
This is linked directly to their internal bug tracker (Radar) so I can assure you it will be read and triaged by an engineering or product manager.
And you might even get a message "Closed as duplicate" three months later...
I’ve long assumed that websites could tell what kind of device I’m using. Is that not true?
On my Google Analytics account, it shows Android mobile devices as their full model names, but iPhones and iPads as just Apple iPhone/iPad.
I'm sure Google could still narrow it down using other factors, like screen size, but they're not sharing that with Analytics users.
I'm sure Google could still narrow it down using other factors, like screen size, but they're not sharing that with Analytics users.
Android Chrome includes phone model in the user-agent.
You can get some details from the User-Agent header https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Us...
You can also get some information from media queries https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queri...
There's other system information you can get from the browser as well
Sometimes you can use this data to see what device/model is being used (although it's trivial to spoof it). In this case, it seems like apple makes it hard to tell exactly which model is being used, so OP is trying to make it easier.
You can also get some information from media queries https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queri...
There's other system information you can get from the browser as well
Sometimes you can use this data to see what device/model is being used (although it's trivial to spoof it). In this case, it seems like apple makes it hard to tell exactly which model is being used, so OP is trying to make it easier.
It recognized an iPhone X as iPhone 8 plus.
I visited it on an iPhone X and it did “Your device is an iPhone X” for me, but I believe you. Not sure why you’re getting downvotes for reporting your own actual user experience... especially on a Show HN... am I missing something?
It seems that beyond the generation it tries to guess the rest based on the screen res changing the font size and DPI via accessibility settings switches between XS and XS max for me.
[deleted]
Not surprising, as they have the same GPU.
There's also navigator.hardwareConcurrency which can tell you the number of CPU threads available to a device.
Unfortunately, it looks like Apple caps this value to 2 on iOS for anti-fingerprinting purposes.
Unfortunately, it looks like Apple caps this value to 2 on iOS for anti-fingerprinting purposes.
Sounds more like “fortunately” for iOS users...
Why include the lookup table in the client code? If you're just mapping (CPU, resolution) to a model, why not just send that tuple to your analytics framework and look it up when displaying? Doing the lookup on the client code means every client has to download the table, and you have to blow away their cached copy whenever you come up with an improvement in the mapping. Limiting it to iDevices certainly makes this table smaller, but I feel like that's a starting off point only... real websites are going to want data about other platforms.
> Why include the lookup table in the client code?
maybe it’s a static site.
maybe it’s a static site.
The example was sending the data to Google Analytics, though.
Which reinforces the need to do the lookup in client code since you can't code it into GA.
I mean you could just get the data from the client that the lookup needs and then send that data to your server for your server to do the lookup and then return the result to the client
but maybe it’s a static site
but maybe it’s a static site
static sites can use google analytics. google analytics is a client side include.
I’ve set up a few static landing pages, and used google analytics to see how much traffic they’re getting, if any
I’ve set up a few static landing pages, and used google analytics to see how much traffic they’re getting, if any
[deleted]
Man, I needed this last summer when I was doing a huge project. Glad someone can benefit from it!