From: Hannes S. <ha...@yl...> - 2012-06-27 19:26:36
Attachments:
new_javascript_windows.patch
|
Hi, the attached patch should finally make the browser handle window.open events correctly. Testing of different websites would be greatly appreciated. Hannes |
From: Hans-Peter D. <hpd...@gm...> - 2012-06-28 00:34:10
|
On Mi, Jun 27 2012, Hannes Schüller wrote: > Hi, > > the attached patch should finally make the browser handle window.open > events correctly. Testing of different websites would be greatly > appreciated. I haven't tested this much, but so far it seems to work. I have published a git branch with the patch for easier testing: http://git.cs.fau.de/?p=lu03pevi/vimprobable;a=shortlog;h=refs/heads/fixes/javascript_windows > -static gboolean > -webview_open_in_new_window_cb(WebKitWebView *webview, WebKitWebFrame *frame, gpointer user_data) { > - Arg a = { .i = TargetNew, .s = (char*)webkit_web_view_get_uri(webview) }; > - if (strlen(rememberedURI) > 0) { > - a.s = rememberedURI; > - } > +void > +webview_open_js_window_cb(WebKitWebView* web_view, GParamSpec param_spec) { > + Arg a = { .i = TargetNew, .s = (char*)webkit_web_view_get_uri(web_view) }; > open_arg(&a); > - return FALSE; > +} > + > +static WebKitWebView * > +webview_open_in_new_window_cb(WebKitWebView *webview, WebKitWebFrame *frame, gpointer user_data) { > + WebKitWebView *new_view = WEBKIT_WEB_VIEW(webkit_web_view_new()); I haven't read the documentation for this, but doesn't "new_view" have to be destroyed somewhere? Otherwise you'll be leaking memory. > + g_object_connect(new_view, "signal::notify::uri", G_CALLBACK(webview_open_js_window_cb), NULL, NULL); > + return new_view; > } HP |
From: Jason R. <jas...@gm...> - 2012-06-28 01:47:29
|
On 28/06/12 at 02:35am, Hans-Peter Deifel wrote: > On Mi, Jun 27 2012, Hannes Schüller wrote: > > Hi, > > > > the attached patch should finally make the browser handle window.open > > events correctly. Testing of different websites would be greatly > > appreciated. > > I haven't tested this much, but so far it seems to work. I have > published a git branch with the patch for easier testing: > > http://git.cs.fau.de/?p=lu03pevi/vimprobable;a=shortlog;h=refs/heads/fixes/javascript_windows > Thanks this works great. There is slightly aberrant behaviour when opening a link from within Google Reader (I know, no-one cares, but I wanted to mention it in case it pops up anywhere else): hitting 'v' opens the linked article in a new window and also opens duckduckgo (default search engine) with an 'about:blank' search. /J -- http://jasonwryan.com/ [GnuPG Key: B1BD4E40] |
From: Hannes S. <ha...@yl...> - 2012-06-28 08:36:27
|
Jason Ryan <jas...@gm...> wrote: > On 28/06/12 at 02:35am, Hans-Peter Deifel wrote: > > On Mi, Jun 27 2012, Hannes Sch__ller wrote: > > > the attached patch should finally make the browser handle > > > window.open events correctly. Testing of different websites would > > > be greatly appreciated. > > > > I haven't tested this much, but so far it seems to work. I have > > published a git branch with the patch for easier testing: > > > > http://git.cs.fau.de/?p=lu03pevi/vimprobable;a=shortlog;h=refs/heads/fixes/javascript_windows > > > Thanks this works great. > > There is slightly aberrant behaviour when opening a link from within > Google Reader (I know, no-one cares, but I wanted to mention it in > case it pops up anywhere else): hitting 'v' opens the linked article > in a new window and also opens duckduckgo (default search engine) > with an 'about:blank' search. Who says no-one cares? Please show me an example (which I don't have to sign up for). If I can reproduce it, I will try to fix this. Though, of course, I'd rather have two windows opened than none ;) Hannes |
From: Jason R. <jas...@gm...> - 2012-06-28 09:38:36
|
On 28/06/12 at 10:32am, Hannes Schüller wrote: > Jason Ryan <jas...@gm...> wrote: > > On 28/06/12 at 02:35am, Hans-Peter Deifel wrote: > > > On Mi, Jun 27 2012, Hannes Sch__ller wrote: > > > > the attached patch should finally make the browser handle > > > > window.open events correctly. Testing of different websites would > > > > be greatly appreciated. > > > > > > I haven't tested this much, but so far it seems to work. I have > > > published a git branch with the patch for easier testing: > > > > > > http://git.cs.fau.de/?p=lu03pevi/vimprobable;a=shortlog;h=refs/heads/fixes/javascript_windows > > > > > Thanks this works great. > > > > There is slightly aberrant behaviour when opening a link from within > > Google Reader (I know, no-one cares, but I wanted to mention it in > > case it pops up anywhere else): hitting 'v' opens the linked article > > in a new window and also opens duckduckgo (default search engine) > > with an 'about:blank' search. > > Who says no-one cares? Please show me an example (which I don't have to > sign up for). If I can reproduce it, I will try to fix this. Though, of > course, I'd rather have two windows opened than none ;) > I meant that as it was a Google-related site, I would not expect much interest from the Vimprobable community (and rightly so…) I've only seen it on that site and it does require a sign on; and yes, you are right, it works twice as well as it used to! /J -- http://jasonwryan.com/ [GnuPG Key: B1BD4E40] |
From: Hannes S. <ha...@yl...> - 2012-06-28 15:28:07
Attachments:
new_javascript_windows.patch
|
Hans-Peter Deifel writes: > I haven't read the documentation for this, but doesn't "new_view" have > to be destroyed somewhere? Otherwise you'll be leaking memory. Here is a revised version of the patch (also with decent comments). Hannes |
From: Hannes S. <ha...@yl...> - 2012-08-16 19:57:39
|
Hannes Schüller writes: > Hans-Peter Deifel writes: >> I haven't read the documentation for this, but doesn't "new_view" have >> to be destroyed somewhere? Otherwise you'll be leaking memory. > > Here is a revised version of the patch (also with decent comments). This version has been merged. Hannes |