Blob Blame History Raw
diff -uNrp a/nemo-preview/configure.ac b/nemo-preview/configure.ac
--- a/nemo-preview/configure.ac
+++ b/nemo-preview/configure.ac
@@ -72,7 +72,7 @@ PKG_CHECK_MODULES(NEMO_PREVIEW,
                   evince-document-3.0
                   evince-view-3.0
                   gtksourceview-3.0
-                  webkitgtk-3.0)
+                  webkit2gtk-4.0)
 
 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
 AC_SUBST(GLIB_MKENUMS)
diff -uNrp a/nemo-preview/src/js/viewers/html.js b/nemo-preview/src/js/viewers/html.js
--- a/nemo-preview/src/js/viewers/html.js
+++ b/nemo-preview/src/js/viewers/html.js
@@ -28,7 +28,7 @@
 const GtkClutter = imports.gi.GtkClutter;
 const Gtk = imports.gi.Gtk;
 const GLib = imports.gi.GLib;
-const WebKit = imports.gi.WebKit;
+const WebKit = imports.gi.WebKit2;
 const NemoPreview = imports.gi.NemoPreview;
 
 const MimeHandler = imports.ui.mimeHandler;
@@ -49,18 +49,16 @@ HTMLRenderer.prototype = {
         this._file = file;
         this._callback = callback;
 
-        this._webView = WebKit.WebView.new();
-        this._scrolledWin = Gtk.ScrolledWindow.new (null, null);
-        this._scrolledWin.add(this._webView);
-        this._scrolledWin.show_all();
+        this._webView = new WebKit.WebView();
+        this._webView.show_all();
 
         /* disable the default context menu of the web view */
-        let settings = this._webView.settings;
-        settings.enable_default_context_menu = false;
+        this._webView.connect ("context-menu",
+                               function() {return true;});
 
         this._webView.load_uri(file.get_uri());
 
-        this._actor = new GtkClutter.Actor({ contents: this._scrolledWin });
+        this._actor = new GtkClutter.Actor({ contents: this._webView });
         this._actor.set_reactive(true);
 
         this._callback();
@@ -94,7 +92,7 @@ HTMLRenderer.prototype = {
 
         return this._toolbarActor;
     }
-}
+};
 
 let handler = new MimeHandler.MimeHandler();
 let renderer = new HTMLRenderer();