diff --git a/configure.ac b/configure.ac
index 1948fed..368d09b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,19 @@ AC_PATH_PROGS(SED, gsed sed)
 AM_PATH_GLIB_2_0
 GLIB_GSETTINGS
 
+AC_ARG_WITH(webkit2,
+        [AC_HELP_STRING([--with-webkit2], [build with WebKit2 [default=no]])],
+        [],[with_webkit2=no])
+
+if test "x$with_webkit2" != xno; then
+   WEBKIT_GTK_PC_NAME=webkit2gtk-3.0
+   AC_DEFINE([HAVE_WEBKIT2],[1],[Define if building with WebKit2])
+   AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBKIT2"
+else
+   WEBKIT_GTK_PC_NAME=webkitgtk-3.0
+fi
+AM_CONDITIONAL(WITH_WEBKIT2, test "x$with_webkit2" != xno)
+
 # Library dependecies
 PKG_CHECK_MODULES(YELP,
 [
@@ -35,7 +48,7 @@ PKG_CHECK_MODULES(YELP,
 	libxslt >= 1.1.4
 	libexslt >= 0.8.1
 	sqlite3
-	webkitgtk-3.0 >= 1.3.10
+	$WEBKIT_GTK_PC_NAME >= 1.3.10
 	yelp-xsl >= 3.1.2
 ])
 AC_SUBST([YELP_CFLAGS])
@@ -254,5 +267,6 @@ yelp-$VERSION:
 	Debug enabled:            ${enable_debug}
 	Enable BZ2:               ${enable_bz2}
 	Enable LZMA:              ${enable_lzma}
+	WebKit2:                  ${with_webkit2}
 
 "
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index f27dd2e..2541071 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -27,7 +27,11 @@
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
+#ifdef HAVE_WEBKIT2
+#include <webkit2/webkit2.h>
+#else
 #include <webkit/webkit.h>
+#endif
 
 #include "yelp-debug.h"
 #include "yelp-docbook-document.h"
@@ -40,6 +44,20 @@
 #define BOGUS_URI "file:///bogus/"
 #define BOGUS_URI_LEN 14
 
+#ifdef HAVE_WEBKIT2
+//TODO
+typedef struct {} WebKitWebFrame;
+typedef struct {} WebKitWebNavigationAction;
+typedef struct {} WebKitNetworkResponse;
+typedef struct {} WebKitNetworkRequest;
+typedef struct {} WebKitWebPolicyDecision;
+typedef struct {} WebKitWebSettings;
+typedef struct {} WebKitDOMDocument;
+typedef struct {} WebKitDOMNode;
+typedef struct {} WebKitDOMElement;
+#define WEBKIT_DOM_IS_ELEMENT(x) 0
+#endif
+
 static void        yelp_view_init                 (YelpView           *view);
 static void        yelp_view_class_init           (YelpViewClass      *klass);
 static void        yelp_view_dispose              (GObject            *object);
@@ -265,7 +283,11 @@ yelp_view_init (YelpView *view)
     GtkAction *action;
     YelpViewPrivate *priv = GET_PRIV (view);
 
+#ifdef HAVE_WEBKIT2
+//TODO unable to set settings at this stage, trying to move it to yelp_view_new
+#else
     g_object_set (view, "settings", websettings, NULL);
+#endif
 
     priv->cancellable = NULL;
 
@@ -368,8 +390,13 @@ yelp_view_class_init (YelpViewClass *klass)
 
     nautilus_sendto = g_find_program_in_path ("nautilus-sendto");
 
+#ifdef HAVE_WEBKIT2
+    websettings = webkit_settings_new ();
+#else
     websettings = webkit_web_settings_new ();
+//TODO
     g_object_set (websettings, "enable-universal-access-from-file-uris", TRUE, NULL);
+#endif
     g_signal_connect (settings,
                       "fonts-changed",
                       G_CALLBACK (settings_set_fonts),
@@ -551,7 +578,12 @@ yelp_view_set_property (GObject      *object,
 GtkWidget *
 yelp_view_new (void)
 {
-    return (GtkWidget *) g_object_new (YELP_TYPE_VIEW, NULL);
+    GtkWidget *obj = (GtkWidget *)g_object_new (YELP_TYPE_VIEW, NULL);
+#ifdef HAVE_WEBKIT2
+//TODO moved from yelp_view_init
+    webkit_web_view_set_settings(WEBKIT_WEB_VIEW(obj), websettings);
+#endif
+    return obj;
 }
 
 void
@@ -1164,6 +1196,11 @@ popup_save_code (GtkMenuItem *item,
     gtk_widget_destroy (dialog);
 }
 
+#ifdef HAVE_WEBKIT2
+//TODO
+static WebKitHitTestResult emptyResult;
+#endif
+
 static void
 view_populate_popup (YelpView *view,
                      GtkMenu  *menu,
@@ -1187,7 +1224,12 @@ view_populate_popup (YelpView *view,
 
     event = gtk_get_current_event ();
 
+#ifdef HAVE_WEBKIT2
+//TODO
+    result = &emptyResult;
+#else
     result = webkit_web_view_get_hit_test_result (WEBKIT_WEB_VIEW (view), (GdkEventButton *) event);
+#endif
     g_object_get (result,
                   "context", &context,
                   "inner-node", &node,
@@ -1233,9 +1275,13 @@ view_populate_popup (YelpView *view,
             gint i, tmpi;
             gboolean ws;
 
+#ifndef HAVE_WEBKIT2
+//TODO
+
             child = (WebKitDOMNode *)
                 webkit_dom_element_query_selector (WEBKIT_DOM_ELEMENT (link_node),
                                                    "span.title", NULL);
+#endif
             if (child != NULL)
                 priv->popup_link_text = webkit_dom_node_get_text_content (child);
 
@@ -1373,13 +1419,21 @@ view_populate_popup (YelpView *view,
         }
     }
 
-    if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION) {
+#ifdef HAVE_WEBKIT2
+//TODO
+if (0) {
+#else
+    if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION)  {
+#endif
         item = gtk_separator_menu_item_new ();
         gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
 
         item = gtk_menu_item_new_with_mnemonic (_("_Copy Text"));
+#ifndef HAVE_WEBKIT2
+//TODO
         g_signal_connect_swapped (item, "activate",
                                   G_CALLBACK (webkit_web_view_copy_clipboard), view);
+#endif
         gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
     }
 
@@ -1423,6 +1477,10 @@ view_navigation_requested (WebKitWebView             *view,
                            WebKitWebPolicyDecision   *decision,
                            gpointer                   user_data)
 {
+#ifdef HAVE_WEBKIT2
+    return FALSE;
+#else
+//TODO request uri
     const gchar *requri = webkit_network_request_get_uri (request);
     YelpViewPrivate *priv = GET_PRIV (view);
     YelpUri *uri;
@@ -1444,7 +1502,7 @@ view_navigation_requested (WebKitWebView             *view,
 
     yelp_view_load_uri ((YelpView *) view, uri);
     g_object_unref (uri);
-
+#endif
     return TRUE;
 }
 
@@ -1457,7 +1515,12 @@ view_resource_request (WebKitWebView         *view,
                        gpointer               user_data)
 {
     YelpViewPrivate *priv = GET_PRIV (view);
+#ifdef HAVE_WEBKIT2
+//TODO
+    const gchar *requri = "dummy for webkit2";
+#else
     const gchar *requri = webkit_network_request_get_uri (request);
+#endif
     gchar last;
     gchar *newpath;
 
@@ -1470,11 +1533,17 @@ view_resource_request (WebKitWebView         *view,
 
     newpath = yelp_uri_locate_file_uri (priv->uri, requri + BOGUS_URI_LEN);
     if (newpath != NULL) {
+#ifndef HAVE_WEBKIT2
+//TODO
         webkit_network_request_set_uri (request, newpath);
+#endif
         g_free (newpath);
     }
     else {
+#ifndef HAVE_WEBKIT2
+//TODO
         webkit_network_request_set_uri (request, "about:blank");
+#endif
     }
 }
 
@@ -1483,6 +1552,8 @@ view_document_loaded (WebKitWebView   *view,
                       WebKitWebFrame  *frame,
                       gpointer         user_data)
 {
+#ifndef HAVE_WEBKIT2
+//TODO webkit2 search control
     YelpViewPrivate *priv = GET_PRIV (view);
     gchar *search_terms;
 
@@ -1513,12 +1584,16 @@ view_document_loaded (WebKitWebView   *view,
         }
         g_free (search_terms);
     }
+#endif
 }
 
 static void
 view_print (GtkAction *action, YelpView  *view)
 {
+#ifndef HAVE_WEBKIT2
+//TODO print
     webkit_web_frame_print (webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view)));
+#endif
 }
 
 static void
@@ -1791,11 +1866,18 @@ view_show_error_page (YelpView *view,
 
     g_signal_emit (view, signals[LOADED], 0);
     g_signal_handler_block (view, priv->navigation_requested);
+#ifdef HAVE_WEBKIT2
+//TODO
+    webkit_web_view_load_html (WEBKIT_WEB_VIEW (view),
+                                 page,
+                                 "file:///error/");
+#else
     webkit_web_view_load_string (WEBKIT_WEB_VIEW (view),
                                  page,
                                  "text/html",
                                  "UTF-8",
                                  "file:///error/");
+#endif
     g_signal_handler_unblock (view, priv->navigation_requested);
     g_free (title_m);
     g_free (content_beg);
@@ -1812,7 +1894,10 @@ settings_set_fonts (YelpSettings *settings)
     gint size;
 
     g_object_set (websettings,
+#ifndef HAVE_WEBKIT2
+//TODO
                   "default-encoding", "utf-8",
+#endif
                   "enable-private-browsing", TRUE,
                   NULL);
 
@@ -2156,11 +2241,18 @@ document_callback (YelpDocument       *document,
                 priv->bogus_uri = g_strdup_printf ("%s%p", BOGUS_URI, priv->uri);
         }
         g_signal_handler_block (view, priv->navigation_requested);
+#ifdef HAVE_WEBKIT2
+//TODO
+        webkit_web_view_load_html (WEBKIT_WEB_VIEW (view),
+                                     contents,
+                                     priv->bogus_uri);
+#else
         webkit_web_view_load_string (WEBKIT_WEB_VIEW (view),
                                      contents,
                                      mime_type,
                                      "UTF-8",
                                      priv->bogus_uri);
+#endif
         g_signal_handler_unblock (view, priv->navigation_requested);
         g_object_set (view, "state", YELP_VIEW_STATE_LOADED, NULL);
 
@@ -2170,6 +2262,10 @@ document_callback (YelpDocument       *document,
          */
         if (priv->vadjust > 0 || priv->hadjust > 0 ||  priv->page_title == NULL)
             while (g_main_context_pending (NULL)) {
+#ifdef HAVE_WEBKIT2
+//TODO
+                g_main_context_iteration (NULL, FALSE);
+#else
                 WebKitLoadStatus status;
                 status = webkit_web_view_get_load_status (WEBKIT_WEB_VIEW (view));
                 g_main_context_iteration (NULL, FALSE);
@@ -2179,6 +2275,7 @@ document_callback (YelpDocument       *document,
                 if (status == WEBKIT_LOAD_FINISHED ||
                     status == WEBKIT_LOAD_FAILED)
                     break;
+#endif
             }
 
         /* Setting adjustments only work after the page is loaded. These
diff --git a/libyelp/yelp-view.h b/libyelp/yelp-view.h
index 53fe511..8f90491 100644
--- a/libyelp/yelp-view.h
+++ b/libyelp/yelp-view.h
@@ -22,7 +22,11 @@
 #define __YELP_VIEW_H__
 
 #include <gtk/gtk.h>
+#ifdef HAVE_WEBKIT2
+#include <webkit2/webkit2.h>
+#else
 #include <webkit/webkit.h>
+#endif
 
 #include "yelp-document.h"
 #include "yelp-uri.h"
diff --git a/src/yelp-window.c b/src/yelp-window.c
index e84e226..20fd74d 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -1131,6 +1131,8 @@ find_entry_key_press (GtkEntry    *entry,
         return TRUE;
     }
 
+#ifndef HAVE_WEBKIT2
+//TODO
     if (event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_KP_Enter) {
         gchar *text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
         webkit_web_view_search_text (WEBKIT_WEB_VIEW (priv->view),
@@ -1138,6 +1140,7 @@ find_entry_key_press (GtkEntry    *entry,
         g_free (text);
         return TRUE;
     }
+#endif
 
     return FALSE;
 }
@@ -1148,17 +1151,22 @@ find_entry_focus_out (GtkEntry      *entry,
                       YelpWindow    *window)
 {
     YelpWindowPrivate *priv = GET_PRIV (window);
+#ifndef HAVE_WEBKIT2
+//TODO
     webkit_web_view_unmark_text_matches (WEBKIT_WEB_VIEW (priv->view));
     webkit_web_view_set_highlight_text_matches (WEBKIT_WEB_VIEW (priv->view), FALSE);
     if (gtk_widget_get_parent (priv->find_bar) != NULL)
-        gtk_container_remove (GTK_CONTAINER (priv->vbox_view), priv->find_bar); 
+        gtk_container_remove (GTK_CONTAINER (priv->vbox_view), priv->find_bar);
     return FALSE;
+#endif
 }
 
 static void
 find_entry_changed (GtkEntry   *entry,
                     YelpWindow *window)
 {
+#ifndef HAVE_WEBKIT2
+//TODO
     gchar *text;
     gint count;
     YelpWindowPrivate *priv = GET_PRIV (window);
@@ -1188,6 +1196,7 @@ find_entry_changed (GtkEntry   *entry,
     }
 
     g_free (text);
+#endif
 }
 
 static gboolean
diff --git a/tests/test-settings.c b/tests/test-settings.c
index 11dc0ca..2da52e8 100644
--- a/tests/test-settings.c
+++ b/tests/test-settings.c
@@ -19,7 +19,11 @@
  */
 
 #include <gtk/gtk.h>
+#ifdef HAVE_WEBKIT2
+#include <webkit2/webkit2.h>
+#else
 #include <webkit/webkit.h>
+#endif
 
 #include "yelp-settings.h"
 
diff --git a/tests/test-view.c b/tests/test-view.c
index 7059d5c..ff520e6 100644
--- a/tests/test-view.c
+++ b/tests/test-view.c
@@ -19,7 +19,11 @@
  */
 
 #include <gtk/gtk.h>
+#ifdef HAVE_WEBKIT2
+#include <webkit2/webkit2.h>
+#else
 #include <webkit/webkit.h>
+#endif
 
 #include "yelp-location-entry.h"
 #include "yelp-view.h"
