webkitpdf.vala
authorAlan Knowles <alan@roojs.com>
Mon, 17 Oct 2016 08:29:51 +0000 (16:29 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 17 Oct 2016 08:29:51 +0000 (16:29 +0800)
webkitpdf.vala

index 06e3610..3c0b86a 100644 (file)
@@ -2,6 +2,11 @@
 /*
  sudo valac   --vapidir=. --thread  webkitpdf.vala  BrowserWindow.vala  --vapidir=./vapi \
     --pkg glib-2.0 --pkg webkit-1.0 --pkg gtk+-2.0 -o /usr/bin/webkitpdf --target-glib=2.32 
+  
+ sudo valac -DGTK3  --vapidir=. --thread  webkitpdf.vala  BrowserWindow.vala  --vapidir=./vapi \
+    --pkg glib-2.0 --pkg webkit2gtk-4.0 --pkg gtk+-3.0 -o /usr/bin/webkitpdf2 --target-glib=2.32 
+  
+  
     
 */
 public class webkitpdf {
@@ -28,13 +33,20 @@ public class webkitpdf {
     public static int main(string[] args) 
     {
         Gtk.init(ref args);
-                
+               
+               
+#if GTK3               
                unowned string proxy = Environment.get_variable ("http_proxy");
                if (proxy != null && proxy.length > 0) {
                        var sess = WebKit.get_default_session();
                        sess.proxy_uri = new Soup.URI(proxy);
                }
-               
+#else
+       // this is a horrific hack from https://bugs.webkit.org/show_bug.cgi?id=128674
+               Environment.unset_variable('GNOME_DESKTOP_SESSION_ID');
+               Environment.unset_variable('DESKTOP_SESSION');          
+               // it should now fallb ack to http prox!?
+#endif         
         var opt_context = new OptionContext ("webkitpdf");