Bug 187172

Summary: [GTK] web inspector does not work with is-ephemeral set to true
Product: WebKit Reporter: Gaute Hope <eg>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: aperez, bugs-noreply, calvaris, cgarcia, mcatanzaro
Priority: P3 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Description Gaute Hope 2018-06-29 02:39:37 PDT
Hi,

it seems that the web inspector cannot be attached when is-ephemeral is set to TRUE. The docs only mention that developer-extras must be enabled.
Comment 2 Adrian Perez 2018-06-29 03:50:41 PDT
Epiphany's incognito windows use ephemeral web contexts, and the
inspector works fine there.

I am not sure whether this would be the reason, but one difference
between the code you linked from Astroid and Epiphany is:

 - Epiphany uses g_object_new() to pass *both* the WebKitWebContext
   and the WebKitSettings objects at construction time.

 - Astroid uses webkit_web_view_new_with_context(), which sets the
   WebKitWebContext only at construction time. After the WebKitWebView
   has been constructed, later on it uses webkit_web_view_set_settings().

Could it be that for some reason some settings cannot are not being
applied correctly when the WebKitSettings is changed after construction
and the WebKitWebContext is ephemeral? If there is something inside
WebKit that prevents the second usage pattern, we should at least add
some notes to the API documentation.

I am adding Carlos GarcĂ­a and Michael Catanzaro on CC, because they
might have some idea about this.
Comment 3 Gaute Hope 2018-07-10 07:33:50 PDT
Using g_object_new (...) and passing a context generated using ..context_new_ephemeral() as well as settings (not with any is-ephemeral property) works.
Comment 4 Michael Catanzaro 2018-07-11 02:11:20 PDT
You're trying to set the is-ephemeral property of WebKitWebSettings, which does not exist. I'm surprised there is no nasty runtime warning about this.

is-ephemeral is a construct-only property of WebKitWebView and WebKitWebsiteDataManager. It's not a WebKitWebSettings property. The property cannot be changed after construct time.