Bug 162548 - [GTK] Require implementation of cpuDescriptionForUAString
Summary: [GTK] Require implementation of cpuDescriptionForUAString
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks: 142074
  Show dependency treegraph
 
Reported: 2016-09-26 01:10 PDT by Michael Catanzaro
Modified: 2016-09-28 03:36 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.41 KB, patch)
2016-09-26 01:12 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2016-09-26 01:10:29 PDT
Require implementation of cpuDescriptionForUAString. Less-popular architectures would probably prefer to get a nice build error here than to wind up with a broken user agent.
Comment 1 Michael Catanzaro 2016-09-26 01:12:18 PDT
Created attachment 289809 [details]
Patch
Comment 2 Carlos Garcia Campos 2016-09-26 01:15:37 PDT
Is this ok for distros like debian that build on different platforms?
Comment 3 Carlos Alberto Lopez Perez 2016-09-26 04:45:48 PDT
(In reply to comment #0)
> Require implementation of cpuDescriptionForUAString. Less-popular
> architectures would probably prefer to get a nice build error here than to
> wind up with a broken user agent.


Why is having the CPU architecture relevant for a webpage to work or not? 

Why we don't just return "Intel" instead of "unknown" or causing an unneeded build failure?
Comment 4 Michael Catanzaro 2016-09-26 11:32:23 PDT
(In reply to comment #2)
> Is this ok for distros like debian that build on different platforms?

I suggest we simply accept patches to add more conditionals here from people working on alternative architectures. If we know how to test for them (I don't) then we could do that now instead of waiting for patches to roll in.

(In reply to comment #3)
> Why we don't just return "Intel" instead of "unknown" or causing an unneeded
> build failure?

I guess we could, but is it really so hard to implement one function when using WebKit on a brand new architecture? This seems quite easy relative to other arch-enablement that might be required.
Comment 5 Carlos Alberto Lopez Perez 2016-09-27 03:15:43 PDT
(In reply to comment #4)
> (In reply to comment #2)
> > Is this ok for distros like debian that build on different platforms?
> 
> I suggest we simply accept patches to add more conditionals here from people
> working on alternative architectures. If we know how to test for them (I
> don't) then we could do that now instead of waiting for patches to roll in.
> 
> (In reply to comment #3)
> > Why we don't just return "Intel" instead of "unknown" or causing an unneeded
> > build failure?
> 
> I guess we could, but is it really so hard to  implement one function when
> using WebKit on a brand new architecture? This seems quite easy relative to
> other arch-enablement that might be required.

The thing is that returning "RISC-V" or "MIPS" is as bad as returning "Unknown".
If the goal is to have sites working on this architectures as best as possible we should just return "Intel" always, because is what sites expect to find.

I don't think a site can have architecture-specific html/css/javascript. So just return Intel instead of Unknown.

UA parsing is broken, so we can't do much about this than returning the more common possible UA string.
Comment 6 Michael Catanzaro 2016-09-27 05:10:40 PDT
Yeah OK.

I wonder if we should do this for ARM too. In Endless we've found that various sites send mobile versions if ARM is in the UA, which is terrible.
Comment 7 Carlos Alberto Lopez Perez 2016-09-27 07:08:55 PDT
(In reply to comment #6)
> Yeah OK.
> 
> I wonder if we should do this for ARM too. In Endless we've found that
> various sites send mobile versions if ARM is in the UA, which is terrible.

Yes, i think so.  Returning "Intel" always without giving further details about the machine CPU architecture looks like a good idea to me.
Comment 8 Zan Dobersek 2016-09-28 03:36:29 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > Yeah OK.
> > 
> > I wonder if we should do this for ARM too. In Endless we've found that
> > various sites send mobile versions if ARM is in the UA, which is terrible.
> 
> Yes, i think so.  Returning "Intel" always without giving further details
> about the machine CPU architecture looks like a good idea to me.

IMO this also helps with improving fingerprinting avoidance.