Bug 193950 - User agent string override for navigator.userAgent should be site specific quirks
Summary: User agent string override for navigator.userAgent should be site specific qu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-01-28 19:41 PST by Ryosuke Niwa
Modified: 2019-01-28 23:15 PST (History)
12 users (show)

See Also:


Attachments
Hides behind site specific quirks (14.62 KB, patch)
2019-01-28 19:49 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Removed superflous auto (14.62 KB, patch)
2019-01-28 20:21 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch for landing (14.90 KB, patch)
2019-01-28 20:50 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixed iOS build (14.89 KB, patch)
2019-01-28 21:40 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>