WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
213573
Allow service workers for web browsers
https://bugs.webkit.org/show_bug.cgi?id=213573
Summary
Allow service workers for web browsers
Kate Cheney
Reported
2020-06-24 13:45:46 PDT
We should allow service workers for full web browsing applications
Attachments
Patch
(17.79 KB, patch)
2020-06-24 14:16 PDT
,
Kate Cheney
no flags
Details
Formatted Diff
Diff
Patch
(4.23 KB, patch)
2020-06-25 10:24 PDT
,
Kate Cheney
no flags
Details
Formatted Diff
Diff
Patch
(4.19 KB, patch)
2020-06-25 11:19 PDT
,
Kate Cheney
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Kate Cheney
Comment 1
2020-06-24 13:46:16 PDT
<
rdar://problem/64712630
>
Kate Cheney
Comment 2
2020-06-24 14:16:43 PDT
Created
attachment 402685
[details]
Patch
youenn fablet
Comment 3
2020-06-25 01:22:33 PDT
Comment on
attachment 402685
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=402685&action=review
> Source/WebKit/ChangeLog:32 > + may run both browser and non-browser tests.
It is not great that we have to add all these TestWebKitAPI checks. Can we just update parentProcessHasServiceWorkerEntitlement to check for both com.apple.developer.WebKit.ServiceWorkers and com.apple.developer.web-browser entitlements? These might be very small changes and manual testing might be good enough. Maybe we could have mini browser have this com.apple.developer.web-browser entitlement btw.
Kate Cheney
Comment 4
2020-06-25 06:52:13 PDT
(In reply to youenn fablet from
comment #3
)
> Comment on
attachment 402685
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=402685&action=review
> > > Source/WebKit/ChangeLog:32 > > + may run both browser and non-browser tests. > > It is not great that we have to add all these TestWebKitAPI checks. > > Can we just update parentProcessHasServiceWorkerEntitlement to check for > both com.apple.developer.WebKit.ServiceWorkers and > com.apple.developer.web-browser entitlements? > These might be very small changes and manual testing might be good enough. > Maybe we could have mini browser have this com.apple.developer.web-browser > entitlement btw.
Yes, combining would work. If we are happy with manual testing then I can also remove the TestWebKitAPI checks. I originally did not give mini browser the entitlement because we have tests which need to not be considered browsers. But I can probably disable the entitlement for those tests just like with the service worker entitlement.
youenn fablet
Comment 5
2020-06-25 07:00:04 PDT
Let's see how the simple combining patch will be. If it is very small, then manual testing might be good enough.
Kate Cheney
Comment 6
2020-06-25 10:24:20 PDT
Created
attachment 402745
[details]
Patch
Brent Fulgham
Comment 7
2020-06-25 10:46:02 PDT
Comment on
attachment 402745
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=402745&action=review
> Source/WebKit/NetworkProcess/ios/NetworkProcessIOS.mm:84 > + static bool hasEntitlement = WTF::hasEntitlement(parentProcessConnection()->xpcConnection(), "com.apple.developer.WebKit.ServiceWorkers") || WTF::hasEntitlement(parentProcessConnection()->xpcConnection(), "com.apple.developer.web-browser");
As Kate pointed out elsewhere, we can probably now get rid of the ServiceWorker entitlement (in a separate patch!)
> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:525 > + bool isFullBrowser = WTF::processHasEntitlement("com.apple.developer.web-browser");
Why isn't this just: bool hasServiceWorkerEntitlement = (WTF::processHasEntitlement("com.apple.developer.WebKit.ServiceWorkers") || WTF::processHasEntitlement("com.apple.developer.web-browser")) && ![_configuration preferences]._serviceWorkerEntitlementDisabledForTesting; ... And then get rid of the 'isFullBrowser' variable? This seems to say that we would not run full web-browser tests where the SW stuff is disabled for testing.
Kate Cheney
Comment 8
2020-06-25 11:05:00 PDT
(In reply to Brent Fulgham from
comment #7
)
> Comment on
attachment 402745
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=402745&action=review
> > > Source/WebKit/NetworkProcess/ios/NetworkProcessIOS.mm:84 > > + static bool hasEntitlement = WTF::hasEntitlement(parentProcessConnection()->xpcConnection(), "com.apple.developer.WebKit.ServiceWorkers") || WTF::hasEntitlement(parentProcessConnection()->xpcConnection(), "com.apple.developer.web-browser"); > > As Kate pointed out elsewhere, we can probably now get rid of the > ServiceWorker entitlement (in a separate patch!) > > > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:525 > > + bool isFullBrowser = WTF::processHasEntitlement("com.apple.developer.web-browser"); > > Why isn't this just: > > bool hasServiceWorkerEntitlement = > (WTF::processHasEntitlement("com.apple.developer.WebKit.ServiceWorkers") || > WTF::processHasEntitlement("com.apple.developer.web-browser")) && > ![_configuration preferences]._serviceWorkerEntitlementDisabledForTesting; > > ... And then get rid of the 'isFullBrowser' variable? > > This seems to say that we would not run full web-browser tests where the SW > stuff is disabled for testing.
That makes sense, will fix and re-upload.
Kate Cheney
Comment 9
2020-06-25 11:19:15 PDT
Created
attachment 402750
[details]
Patch
Brent Fulgham
Comment 10
2020-06-25 12:03:46 PDT
Comment on
attachment 402750
[details]
Patch r=me
EWS
Comment 11
2020-06-25 13:04:56 PDT
Committed
r263525
: <
https://trac.webkit.org/changeset/263525
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 402750
[details]
.
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