webkit1 gtk has an API to get the default SoupSession which would be useful for extensions on webkit2. The API can be used for example to set proxy settings directly on the SoupSession from extensions (which run in the WebProcess). Patch to come next.
Created attachment 215352 [details] Patch Add webkit_get_default_session API to wk2.
Created attachment 215384 [details] Patch Fix build issues with documentation.
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings?
Note that this might now work anymore if we switch to use the network process.
It depends how complicated the app wants to get with its proxy settings...
(In reply to comment #4) > We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings? You mean an API for web-extension (Web Process) or a webview/context API (UI Process)? If for the extension we could easily add a webkit_set_proxy_resolver(GProxyResolver*) instead of exposing the SoupSession. If you mean an API for webview/context we would have to pass the info all the way to the Web Process, and I am not sure how flexible this would be. I believe exposing the SoupSession has other advantages where the user can tweak the session to their needs more easily. I wasn't aware of this switch to network process though.
(In reply to comment #7) > (In reply to comment #4) > > We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings? > > You mean an API for web-extension (Web Process) or a webview/context API (UI Process)? For the UI process would be better, that way it will work even if we switch to network process or implement multi-web-process support. > If for the extension we could easily add a webkit_set_proxy_resolver(GProxyResolver*) instead of exposing the SoupSession. If you mean an API for webview/context we would have to pass the info all the way to the Web Process, and I am not sure how flexible this would be. It's what we do for custom uri schemes, cookies, disk cache, http auth, etc. > I believe exposing the SoupSession has other advantages where the user can tweak the session to their needs more easily. what other things do you need to tweak? > I wasn't aware of this switch to network process though. Well, it's not even supported yet, but we might eventually switch.
(In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #4) > > > We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings? > > > > You mean an API for web-extension (Web Process) or a webview/context API (UI Process)? > > For the UI process would be better, that way it will work even if we switch to network process or implement multi-web-process support. > Indeed, I agree, just not sure how to support for example custom GProxyResolver in this case. > > If for the extension we could easily add a webkit_set_proxy_resolver(GProxyResolver*) instead of exposing the SoupSession. If you mean an API for webview/context we would have to pass the info all the way to the Web Process, and I am not sure how flexible this would be. > > It's what we do for custom uri schemes, cookies, disk cache, http auth, etc. > > > I believe exposing the SoupSession has other advantages where the user can tweak the session to their needs more easily. > > what other things do you need to tweak? > I mean that you would have more flexibility here, anything available in the SoupSession could be easily tweaked to the user liking. But yeah, with the possibility of switching to network process this patch makes no sense. > > I wasn't aware of this switch to network process though. > > Well, it's not even supported yet, but we might eventually switch. Got it. Thanks for the comments, I will close here as WONTFIX as I won't have time to work on a proper patch for the UIProcess API.
Comment on attachment 215384 [details] Patch Cleared review? from attachment 215384 [details] so that this bug does not appear in http://webkit.org/pending-review. If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).