iOS WKWebView's WKProcessPool - when is it safe to share the same process space?

21 views Asked by At

My app uses lots of WKWebView to render different websites. Think of a browser app for example. These are third party websites being loaded from various domains not under my control.

I am reading the docs:

https://developer.apple.com/documentation/webkit/wkprocesspool

and Apple says:

A WKProcessPool object represents a single process that WebKit uses to manage web content. To provide a more secure and stable experience, WebKit renders the content of web views in separate processes, rather than in your app’s process space. By default, WebKit gives each web view its own process space until it reaches an implementation-defined process limit. After that, web views with the same WKProcessPool object share the same web content process. If your app creates multiple web views, assign the same WKProcessPool object to web views that may safely share a process space. Instantiate an instance of this class and assign it to the processPool property of each web view’s WKWebViewConfiguration object.

I am unsure about the "to web views that may safely share a process space" part.

When exactly is it safe to share the same process space? Is it when browsing the same domain? I am guessing no because a website can load content from other sites (JS, CSS, images etc). So when is it safe?

Can I just use a single WKProcessPool for all the WkWebViews?

0

There are 0 answers