By Eduardo Lima.
Latest developments in GNOME’s Web and its engine WebKitGTK+ has finally closed the gap, giving our platform a beautiful, robust, modern and feature-rich Web browser.
This is a presentation on the state of Web technologies on GNOME, briefly discussing the latest architectural changes and feature additions, and a look at the future.
7. WebKitGTK+
· What happened?
Multiple Web processes
DOM touch events support
Plugins cache
New API
WebKit1 API deprecation
many bugfixes, as usual
·
·
·
·
·
·
7/36
9. Multiple Web processes
Essentially, one process per tab
plus other auxiliary processes
Goals
Enabled by default in Web, possible to opt-out
·
·
·
Page crashes don't crash the browser
Put vulnerable data into a separate address space
·
·
·
9/36
13. Multiple Web processes
Opt-in/out (GSettings)
gsettings set org.gnome.Epiphany
process-model one-secondary-process-per-web-view // or 'shared-secondary-process'
13/36
14. Multiple Web processes
Opt-in/out (API)
int main(int argc, char **argv)
{
webkit_web_context_set_process_model (
webkit_web_context_get_default (),
WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
/* The rest of the application code, unmodified */
}
14/36
16. Multiple Web processes
· Downside:
More memory hungry
Added complexity on Web extensions setup
Added complexity on process management (spawning/killing)
-
-
-
16/36
17. Multiple Web processes
It is possible for Web views to share a Web process (new API)
GtkWidget *view, *related_view, *unrelated_view;
void create_views ()
{
/* Create two views which share a Web Process */
view = webkit_web_view_new ();
related_view =
webkit_web_view_new_with_related_view (WEBKIT_WEB_VIEW (view));
/* This view will spawn a new Web Process */
unrelated_view = webkit_web_view_new ();
}
17/36
18. Multiple Web processes
· Initializing Web extensions now (new API)
· #define WEB_EXTENSIONS_DIRECTORY /* ... */
int main (int argc, char **argv)
{
WebKitWebContext *context = webkit_web_context_get_default ();
GVariant *data = get_data_for_web_extensions ();
webkit_web_context_set_web_extensions_directory (
context, WEB_EXTENSIONS_DIRECTORY);
webkit_web_context_set_web_extensions_initialization_user_data (
context, data);
GtkWidget *view = webkit_web_view_new ();
/* ... */
}
18/36
19. Multiple Web processes
· ... and in the extension
· void webkit_web_extension_initialize_with_user_data (
WebKitWebExtension *extension, GVariant *user_data)
{
/* Initialize the extension, using “user_data” */
}
19/36
20. Multiple Web processes
· More complexity: Different data per instance of a Web extension
New signal ::initialize-web-extensions
(I promise next is the last slide with code)
·
·
20/36
21. #define WEB_EXTENSIONS_DIRECTORY /* ... */
static void
initialize_web_extensions (WebKitWebContext *context, gpointer user_data)
{
/* Web Extensions get a different ID for each Web Process */
static guint32 unique_id = 0;
webkit_web_context_set_web_extensions_directory (
context, WEB_EXTENSIONS_DIRECTORY);
webkit_web_context_set_web_extensions_initialization_user_data (
context, g_variant_new_uint32 (unique_id++));
}
int main (int argc, char **argv)
{
g_signal_connect (webkit_web_context_get_default (),
"initialize-web-extensions",
G_CALLBACK (initialize_web_extensions),
NULL);
GtkWidget *view = webkit_web_view_new ();
/* ... */
}
21/36
22. DOM touch events support
VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd.....
00::0000
screencast by Carlos Garnacho
·
22/36
23. Plugins cache
Plugins are synchronously scanned on first use, can't be avoided
but now that's done once, and cached for later
·
·
23/36
24. WebKit1 deprecation
WebKit1 completely removed from trunk
Have you already ported your app?
2.6 will no longer ship WebKit1 API
·
·
·
24/36
26. Overview turned into an HTML page
Removed complex GTK+ widgets, along with 1000s of lines of code
Overview now a themable and animatable HTML document
·
·
26/36
27. Overview turned into an HTML page
VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd.....
00::0000
screencast by Claudio Saavedra
27/36
28. A new location/title headerbar
VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd.....
00::0000
screencast by Claudio Saavedra
28/36
33. The future
Next releases: Web 3.16 for September 2014
WebKitGTK+ 2.6 (a bit behind schedule)
·
·
33/36
34. The future
· WebKitGTK
WebRTC
Accelerated-compositing support on Wayland
Sandbox WebProcesses
New API
Initial WebCrypto spec support
Database Process?
·
·
·
·
User scripts and messaging
API for loading arbitrary content-type
·
·
·
·
34/36
35. The future
· GNOME Web
Important security and stability improvements
Bring back the pop-up blocker
More multi-WebProcess models
-
HTTPS blocking
Mixed-content blocking (HTTPS vs. HTTP)
-
-
-
-
- i.e: One process per security-domain
35/36