#if GTK3
- print("PNG not supported in webkit2\n");
+ this.printpng();
+ //print("PNG not supported in webkit2\n");
return;
#else
print("making screenshot\n");
#if GTK3
+ GLib.MainLoop mainloop = new GLib.MainLoop();
+ _this.view.el.get_snapshot.begin(WebKit.SnapshotRegion.FULL_DOCUMENT, WebKit.SnapshotOptions.NONE, null, (obj, res) => {
+ var sf = _this.view.el.get_snapshot.end(res);
+ sf.write_to_png(webkitpdf.opt_target_png);
+ print("Saved to %s\n", webkitpdf.opt_target_png);
+ mainloop.quit();
+
+ });
+
+ mainloop.run();
#else
// fix vapi - get_snapshot add '?' to all null.
// sf.write_to_png(Browser.opt_target_png);
//});
+ #endif
this.delete_cookiefile();
+
Gtk.main_quit();
- #endif
+