Web 3.12 
A browser to make us proud 
Eduardo Lima 
Igalia 
Strasbourg, July 27th, 2014
+ = 
3/36
scope 
· 
Web 3.12: released March 2014 
· 
(Web 3.10 released September 2013) 
· 
WebKitGTK+ 2.4.0: also released March 2014 
4/36
scope 
focus on last stable release cycle 
5/36
WebKitGTK+ 2.4 
6/36
WebKitGTK+ 
· What happened? 
Multiple Web processes 
DOM touch events support 
Plugins cache 
New API 
WebKit1 API deprecation 
many bugfixes, as usual 
· 
· 
· 
· 
· 
· 
7/36
Multiple Web processes 
by Adrian Perez 
8/36
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
Multiple Web processes 
before 2.4 
10/36
Multiple Web processes 
after 2.4 
11/36
Multiple Web processes in practice: 
screenshot by Alex Diavatis 
12/36
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
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
Multiple Web processes 
by Adrian Perez 
15/36
Multiple Web processes 
· Downside: 
More memory hungry 
Added complexity on Web extensions setup 
Added complexity on process management (spawning/killing) 
- 
- 
- 
16/36
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
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
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
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
#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
DOM touch events support 
VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd..... 
00::0000 
screencast by Carlos Garnacho 
· 
22/36
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
WebKit1 deprecation 
WebKit1 completely removed from trunk 
Have you already ported your app? 
2.6 will no longer ship WebKit1 API 
· 
· 
· 
24/36
Web 3.12 
25/36
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
Overview turned into an HTML page 
VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd..... 
00::0000 
screencast by Claudio Saavedra 
27/36
A new location/title headerbar 
VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd..... 
00::0000 
screencast by Claudio Saavedra 
28/36
Most dialogs cleaned up and revamped 
screenshot by Claudio Saavedra 
29/36
New designs for incognito mode 
screenshot by Claudio Saavedra 
30/36
Other improvements 
· Configure search engine from Preferences 
31/36
The future 
32/36
The future 
Next releases: Web 3.16 for September 2014 
WebKitGTK+ 2.6 (a bit behind schedule) 
· 
· 
33/36
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
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
Thank You! 
(q&a) 
twitter @elimitev 
www blogs.igalia.com/elima 
36/36

Web 3.12: A browser to make us proud (GUADEC 2014)

  • 2.
    Web 3.12 Abrowser to make us proud Eduardo Lima Igalia Strasbourg, July 27th, 2014
  • 3.
  • 4.
    scope · Web3.12: released March 2014 · (Web 3.10 released September 2013) · WebKitGTK+ 2.4.0: also released March 2014 4/36
  • 5.
    scope focus onlast stable release cycle 5/36
  • 6.
  • 7.
    WebKitGTK+ · Whathappened? Multiple Web processes DOM touch events support Plugins cache New API WebKit1 API deprecation many bugfixes, as usual · · · · · · 7/36
  • 8.
    Multiple Web processes by Adrian Perez 8/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
  • 10.
    Multiple Web processes before 2.4 10/36
  • 11.
    Multiple Web processes after 2.4 11/36
  • 12.
    Multiple Web processesin practice: screenshot by Alex Diavatis 12/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
  • 15.
    Multiple Web processes by Adrian Perez 15/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 eventssupport VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd..... 00::0000 screencast by Carlos Garnacho · 22/36
  • 23.
    Plugins cache Pluginsare synchronously scanned on first use, can't be avoided but now that's done once, and cached for later · · 23/36
  • 24.
    WebKit1 deprecation WebKit1completely removed from trunk Have you already ported your app? 2.6 will no longer ship WebKit1 API · · · 24/36
  • 25.
  • 26.
    Overview turned intoan 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 intoan HTML page VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd..... 00::0000 screencast by Claudio Saavedra 27/36
  • 28.
    A new location/titleheaderbar VVVVViiiiidddddeeeeeooooo fffffooooorrrrrmmmmmaaaaattttt ooooorrrrr MMMMMIIIIIMMMMMEEEEE tttttyyyyypppppeeeee iiiiisssss nnnnnooooottttt sssssuuuuuppppppppppooooorrrrrttttteeeeeddddd..... 00::0000 screencast by Claudio Saavedra 28/36
  • 29.
    Most dialogs cleanedup and revamped screenshot by Claudio Saavedra 29/36
  • 30.
    New designs forincognito mode screenshot by Claudio Saavedra 30/36
  • 31.
    Other improvements ·Configure search engine from Preferences 31/36
  • 32.
  • 33.
    The future Nextreleases: 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
  • 36.
    Thank You! (q&a) twitter @elimitev www blogs.igalia.com/elima 36/36