2 * Idea is to serve the files from the file system, so no need to setup apache etc...
3 * This should work for the static content like css / javascript etc.. but
4 * will cause issues with 'dynamic' xhr files (eg. the php stuff)
6 * the idea is nicked from geary.
10 public class FakeServer : Object
14 public FakeServer(Webkit.WebView wkview)
21 this.wkview.load_finished.connect(on_load_finished);
22 this.wkview.resource_request_starting.connect(on_resource_request_starting);
23 this.wkview.navigation_policy_decision_requested.connect(on_navigation_policy_decision_requested);
24 this.wkview.new_window_policy_decision_requested.connect(on_navigation_policy_decision_requested);
26 // Load the HTML into WebKit.
27 // Note: load_finished signal MUST be hooked up before this call.
28 string html_text = GearyApplication.instance.read_theme_file("message-viewer.html") ?? "";
29 load_string(html_text, "text/html", "UTF8", "");
32 private bool on_navigation_policy_decision_requested(
33 WebKit.WebFrame frame,
34 WebKit.NetworkRequest request,
35 WebKit.WebNavigationAction navigation_action,
36 WebKit.WebPolicyDecision policy_decision
38 policy_decision.ignore();
40 // not sure if we should allow navigations...