<p><br>HI all: <br> <br> I come to some problems when i use the webkit. when the browser need to create a new window to open the new </p>
<p>link,the webkit can't provide a right singal.As you know many browsers for mobile devices use WebKit at the core of </p>
<p>the application, such as OpenMoko-Browser. <br> First i compile the main.c in the path /WebKit/WebKitTools/GtkLauncher.and run it on my X86 computer.In the entry </p>
<p>of the browser,I input <a href="http://www.google.com/">www.google.com</a> . the browser open the website correctly.then i input the key word "baidu" in </p>
<p>the search filed. the google will list many websites related "baidu". but when i click one of them, the browser do </p>
<p>nothing and can't open the site. how can i display the website responding to the click?<br> The same things happened on the openmoko-browser2. but when i use the gpe-mini-browser,it can work very well.<br> As you konw the gpe-mini-browser use osb-nrcit and osb-nrcore at the core of the application.then i compare them </p>
<p>and find that there is a defined signal "req_new_window" in osb-nrcit. the signal "req_new_window" can notify the </p>
<p>application that whether the browser create a new page to open the url. Below is the key code :<br> <br> g_signal_connect (G_OBJECT(html), "req_new_window", <br> G_CALLBACK(new_window), html);<br> <br>
GtkWidget * new_window(Webi * view, char const * url, gpointer data)<br>{<br>if (fork())<br> return NULL;<br>else<br> {<br> printf("url = %s\n", url);<br> execlp("gpe-mini-browser", "gpe-mini-browser", url);<br>
}<br> return NULL;<br>}<br> <br>in the webkit i find the signal "hovering-over-link",and i modify the /WebKit/WebKitTools/GtkLauncher/main.c as </p>
<p>follow:<br> <br>static GtkWidget* link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data)<br>{<br> /* underflow is allowed */<br> gtk_statusbar_pop (main_statusbar, status_context_id);<br>
if (link)<br> {<br> gtk_statusbar_push (main_statusbar, status_context_id, link);<br> if (fork())<br> return NULL;<br> else<br> {<br> printf("url = %s\n", link);<br>
execlp("/home/root/openmoko-browser2", "/home/root/openmoko-browser2", link);<br> }<br> }<br> return NULL;<br>}<br> <br>then i compile it and run, we can solove the above problem, But when the brower visit some websites, the browser </p>
<p>create two same pages when i click the link.<br> <br> Next, how can i display the website responding to the click in the webkit correctly?<br>thanks! </p>