Bug 193950

Summary: User agent string override for navigator.userAgent should be site specific quirks
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: WebKit2Assignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, bfulgham, cdumez, commit-queue, dbates, ews-watchlist, ggaren, hi, japhet, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=193762
Attachments:
Description Flags
Hides behind site specific quirks
none
Removed superflous auto
none
Patch for landing
none
Fixed iOS build none

Description Ryosuke Niwa 2019-01-28 19:41:47 PST
In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
we need to put this behind the site specific quirks.
Comment 1 Ryosuke Niwa 2019-01-28 19:49:50 PST
Created attachment 360425 [details]
Hides behind site specific quirks
Comment 2 Brent Fulgham 2019-01-28 20:11:52 PST
Comment on attachment 360425 [details]
Hides behind site specific quirks

View in context: https://bugs.webkit.org/attachment.cgi?id=360425&action=review

> Source/WebCore/loader/FrameLoader.cpp:2719
> +            auto userAgent = documentLoader->customJavaScriptUserAgentAsSiteSpecificQuirks();

I don't think you want to declare it 'auto' here -- won't it go out of scope after this line?
Comment 3 Ryosuke Niwa 2019-01-28 20:19:53 PST
(In reply to Brent Fulgham from comment #2)
> Comment on attachment 360425 [details]
> Hides behind site specific quirks
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=360425&action=review
> 
> > Source/WebCore/loader/FrameLoader.cpp:2719
> > +            auto userAgent = documentLoader->customJavaScriptUserAgentAsSiteSpecificQuirks();
> 
> I don't think you want to declare it 'auto' here -- won't it go out of scope
> after this line?

Oh oops, I forgot to remove that auto after moving the code around.
Comment 4 Ryosuke Niwa 2019-01-28 20:21:49 PST
Created attachment 360429 [details]
Removed superflous auto
Comment 5 Brent Fulgham 2019-01-28 20:24:23 PST
Comment on attachment 360429 [details]
Removed superflous auto

r=mews
Comment 6 Ryosuke Niwa 2019-01-28 20:49:24 PST
Oops, I forgot to enable SiteSpecificQuirks in API tests.
Comment 7 Ryosuke Niwa 2019-01-28 20:50:24 PST
Created attachment 360430 [details]
Patch for landing
Comment 8 Ryosuke Niwa 2019-01-28 21:00:44 PST
Comment on attachment 360430 [details]
Patch for landing

Wait for EWS
Comment 9 Ryosuke Niwa 2019-01-28 21:40:55 PST
Created attachment 360437 [details]
Fixed iOS build
Comment 10 Ryosuke Niwa 2019-01-28 23:15:02 PST
Committed r240646: <https://trac.webkit.org/changeset/240646>
Comment 11 Radar WebKit Bug Importer 2019-01-28 23:15:40 PST
<rdar://problem/47624338>