<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Gtk] can not show json data (local file restrictions?)"
   href="https://bugs.webkit.org/show_bug.cgi?id=161591#c11">Comment # 11</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Gtk] can not show json data (local file restrictions?)"
   href="https://bugs.webkit.org/show_bug.cgi?id=161591">bug 161591</a>
              from <span class="vcard"><a class="email" href="mailto:hqwu&#64;fiberhome.com" title="hqwu &lt;hqwu&#64;fiberhome.com&gt;"> <span class="fn">hqwu</span></a>
</span></b>
        <pre>my source code as below:

#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &lt;webkit2/webkit2.h&gt;
#include &lt;gtk/gtk.h&gt;


static void load_finished(WebKitWebView *view, gpointer data)
{
   printf(&quot;called_load_fininshed\n&quot;);
   printf(&quot;get_url:%s\n&quot;, webkit_web_view_get_uri(view) );
   printf(&quot;get_tiele:%s\n&quot;, webkit_web_view_get_title(view) );
}


int main(int argc, char **argv)
{
   for(int i=1; i&lt;argc; i++)
   {
      printf(&quot;input_pm[%d]:%s\n&quot;, i, argv[i]);
   }

   if( setenv (&quot;DISPLAY&quot;, &quot;:0&quot;, 0) != 0 )
   {
        printf(&quot;set display:1 failed\n&quot;);
        return -1;
   }

   printf(&quot;check thread_support\n&quot;);
   if (!g_thread_supported ())
      g_thread_init (NULL);

   printf(&quot;init gtk\n&quot;);
   gtk_init (&amp;argc, &amp;argv);

   /*
   WebKitWebFrame *web_frame = NULL;
   */
   GtkWidget      *web_view  = NULL;
   GtkWidget      *window    = NULL;
   GtkWidget      *scrolled  = NULL;


   printf(&quot;create a top window\n&quot;);
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);


   printf(&quot;set window size\n&quot;);
   gtk_window_set_default_size (GTK_WINDOW (window), 1024, 768);


   scrolled = gtk_scrolled_window_new (NULL, NULL);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);


   printf(&quot;create a webview\n&quot;);
   web_view = webkit_web_view_new ();


   printf(&quot;add webview to window\n&quot;);
   gtk_container_add (GTK_CONTAINER (scrolled), web_view);
   gtk_container_add (GTK_CONTAINER (window), scrolled);


   printf(&quot;show window\n&quot;);
   gtk_widget_show_all (window);


   printf(&quot;set call back of webpage loaded\n&quot;);
   g_signal_connect(web_view, &quot;load-finished&quot;, G_CALLBACK(load_finished), NULL);


   printf(&quot;load a web page\n&quot;);
   webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), &quot;<a href="http://127.0.0.1/testjson">http://127.0.0.1/testjson</a>&quot;);

   printf(&quot;gtk_main\n&quot;);
   gtk_main();


   return 0;

}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>