WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
180566
Service Worker should use a correct user agent
https://bugs.webkit.org/show_bug.cgi?id=180566
Summary
Service Worker should use a correct user agent
youenn fablet
Reported
2017-12-07 19:05:45 PST
Currently, it is the empty string
Attachments
Patch
(27.00 KB, patch)
2017-12-08 13:26 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(26.84 KB, patch)
2017-12-08 14:31 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(27.96 KB, patch)
2017-12-08 15:20 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(27.73 KB, patch)
2017-12-08 16:18 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Addendum
(1.89 KB, patch)
2017-12-08 21:04 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2017-12-07 19:06:02 PST
<
rdar://problem/35926295
>
youenn fablet
Comment 2
2017-12-08 13:26:25 PST
Created
attachment 328861
[details]
Patch
EWS Watchlist
Comment 3
2017-12-08 13:28:36 PST
Attachment 328861
[details]
did not pass style-queue: ERROR: Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h:91: The parameter name "userAgent" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:74: Missing spaces around : [whitespace/init] [4] Total errors found: 2 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
youenn fablet
Comment 4
2017-12-08 14:31:34 PST
Created
attachment 328870
[details]
Patch
EWS Watchlist
Comment 5
2017-12-08 14:34:35 PST
Attachment 328870
[details]
did not pass style-queue: ERROR: Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h:90: The parameter name "userAgent" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:74: Missing spaces around : [whitespace/init] [4] Total errors found: 2 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
youenn fablet
Comment 6
2017-12-08 15:20:37 PST
Created
attachment 328877
[details]
Patch
EWS Watchlist
Comment 7
2017-12-08 15:21:50 PST
Attachment 328877
[details]
did not pass style-queue: ERROR: Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h:90: The parameter name "userAgent" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:74: Missing spaces around : [whitespace/init] [4] Total errors found: 2 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 8
2017-12-08 15:24:53 PST
Comment on
attachment 328870
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=328870&action=review
> Source/WebKit/UIProcess/WebPageProxy.cpp:2355 > + process().processPool().updateServiceWorkerUserAgent(userAgent());
Seems like it would be more robust if this were in WebPageProxy::setUserAgent(), no? Also, this looks hackish so I think it deserves a FIXME comment.
> Source/WebKit/UIProcess/WebProcessPool.cpp:1030 > + updateServiceWorkerUserAgent(pageProxy->userAgent());
Won't this temporarily reset the SW user agent to some default one until WebPageProxy::setUserAgent() gets called with the proper one? Given that the SW process is shared between all pages, I slightly worry about frequent changes to the SW process user agent (especially with sometimes a wrong user agent). A ServiceWorker may get spawned at any time, and one it is spawned, its user agent persists. Therefore, if it ended up using a bad user agent (bad luck), it is stuck with this bad user agent.
youenn fablet
Comment 9
2017-12-08 16:18:11 PST
Created
attachment 328882
[details]
Patch
EWS Watchlist
Comment 10
2017-12-08 16:20:27 PST
Attachment 328882
[details]
did not pass style-queue: ERROR: Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h:90: The parameter name "userAgent" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:74: Missing spaces around : [whitespace/init] [4] Total errors found: 2 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 11
2017-12-08 17:06:02 PST
Comment on
attachment 328882
[details]
Patch Clearing flags on attachment: 328882 Committed
r225716
: <
https://trac.webkit.org/changeset/225716
>
WebKit Commit Bot
Comment 12
2017-12-08 17:06:04 PST
All reviewed patches have been landed. Closing bug.
youenn fablet
Comment 13
2017-12-08 21:04:30 PST
Reopening to attach new patch.
youenn fablet
Comment 14
2017-12-08 21:04:32 PST
Created
attachment 328901
[details]
Addendum
youenn fablet
Comment 15
2017-12-08 21:05:28 PST
(In reply to youenn fablet from
comment #14
)
> Created
attachment 328901
[details]
> Addendum
We actually need to set the user agent when starting the SW for Safari.
WebKit Commit Bot
Comment 16
2017-12-08 21:36:40 PST
Comment on
attachment 328901
[details]
Addendum Clearing flags on attachment: 328901 Committed
r225720
: <
https://trac.webkit.org/changeset/225720
>
WebKit Commit Bot
Comment 17
2017-12-08 21:36:42 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug