Strasbourg, July 27th, 2014

+ =

scope

  • Web 3.12: released March 2014

  • (Web 3.10 released September 2013)
  • WebKitGTK+ 2.4.0: also released March 2014

scope

focus on last stable release cycle

WebKitGTK+ 2.4

WebKitGTK+

  • What happened?
    • Multiple Web processes
    • DOM touch events support
    • Plugins cache
    • New API
    • WebKit1 API deprecation
    • many bugfixes, as usual

Multiple Web processes

by Adrian Perez

Multiple Web processes

  • Essentially, one process per tab
  • plus other auxiliary processes
  • Goals
    • Page crashes don't crash the browser
    • Put vulnerable data into a separate address space
  • Enabled by default in Web, possible to opt-out

Multiple Web processes

before 2.4


Multiple Web processes

after 2.4


Multiple Web processes

in practice:

screenshot by Alex Diavatis

Multiple Web processes

Opt-in/out (GSettings)

gsettings set org.gnome.Epiphany \
    process-model one-secondary-process-per-web-view // or 'shared-secondary-process'
        

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 */
        }
        

Multiple Web processes

by Adrian Perez

Multiple Web processes

  • Downside:
    • More memory hungry
    • Added complexity on Web extensions setup
    • Added complexity on process management (spawning/killing)

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 ();
}        

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 ();
    
      /* ... */
    }
              

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” */
    }
              

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)

#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 ();

  /* ... */
}
    

DOM touch events support

  • screencast by Carlos Garnacho

Plugins cache

  • Plugins are synchronously scanned on first use, can't be avoided
  • but now that's done once, and cached for later

WebKit1 deprecation

  • WebKit1 completely removed from trunk
  • Have you already ported your app?
  • 2.6 will no longer ship WebKit1 API

Web 3.12

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

Overview turned into an HTML page

screencast by Claudio Saavedra

A new location/title headerbar

screencast by Claudio Saavedra

Most dialogs cleaned up and revamped

screenshot by Claudio Saavedra

New designs for incognito mode

screenshot by Claudio Saavedra

Other improvements

  • Configure search engine from Preferences

The future

The future

  • Next releases: Web 3.16 for September 2014
  • WebKitGTK+ 2.6 (a bit behind schedule)

The future

  • WebKitGTK
    • WebRTC
    • Accelerated-compositing support on Wayland
    • Sandbox WebProcesses
    • New API
      • User scripts and messaging
      • API for loading arbitrary content-type
    • Initial WebCrypto spec support
    • Database Process?

The future

  • GNOME Web
    • Important security and stability improvements
      • HTTPS blocking
      • Mixed-content blocking (HTTPS vs. HTTP)
    • Bring back the pop-up blocker
    • More multi-WebProcess models
      • i.e: One process per security-domain

Thank You!

(q&a)