An initial implementaion would allow to open links in a new browser window from the context menu, see bug #54827.
Created attachment 89348 [details] Patch It also allows to open more than one window from the command line. It depends on bug #58024
Comment on attachment 89348 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=89348&action=review > Tools/MiniBrowser/gtk/BrowserWindow.c:52 > +static void browserWindowUiClientInit(BrowserWindow*); Should be browserWindowUIClientInit > Tools/MiniBrowser/gtk/BrowserWindow.c:390 > +{ > + WKViewRef webView = WKViewCreate(WKPageGetContext(page), 0); > + BrowserWindow* window = BROWSER_WINDOW(browserWindowNew(webView)); > + return WKViewGetPage(window->webView); > +} Maybe browser_window_new should take in the features dictionary to set the size, etc. > Tools/MiniBrowser/gtk/BrowserWindow.c:426 > + WKPageUIClient uiClient = { > + 0, /* version */ > + window, /* clientInfo */ > + createNewPage, > + showPage, > + closePage, > + runJavaScriptAlert, > + 0, /* runJavaScriptConfirm */ > + 0, /* runJavaScriptPrompt */ > + 0, /* setStatusText */ > + 0, /* mouseDidMoveOverElement */ > + 0, /* missingPluginButtonClicked */ > + 0, /* didNotHandleKeyEvent */ > + 0, /* toolbarsAreVisible */ > + 0, /* setToolbarsAreVisible */ > + 0, /* menuBarIsVisible */ > + 0, /* setMenuBarIsVisible */ Please line up the comments on these lines. :) > Tools/MiniBrowser/gtk/main.c:43 > +static void loadUri(const gchar *uri) Should be loadURI. > Tools/MiniBrowser/gtk/main.c:57 > + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URLâ¦]" }, Are there some extra characters at the end of "[URLâ¦]"
(In reply to comment #2) > (From update of attachment 89348 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=89348&action=review > > > Tools/MiniBrowser/gtk/BrowserWindow.c:52 > > +static void browserWindowUiClientInit(BrowserWindow*); > > Should be browserWindowUIClientInit Ok. > > Tools/MiniBrowser/gtk/BrowserWindow.c:390 > > +{ > > + WKViewRef webView = WKViewCreate(WKPageGetContext(page), 0); > > + BrowserWindow* window = BROWSER_WINDOW(browserWindowNew(webView)); > > + return WKViewGetPage(window->webView); > > +} > > Maybe browser_window_new should take in the features dictionary to set the size, etc. We could use the features to set up the window before showing it, but I'm not sure the window should take the features. We can leave this for future patches, other ports ignore this for now too. > > Tools/MiniBrowser/gtk/BrowserWindow.c:426 > > + WKPageUIClient uiClient = { > > + 0, /* version */ > > + window, /* clientInfo */ > > + createNewPage, > > + showPage, > > + closePage, > > + runJavaScriptAlert, > > + 0, /* runJavaScriptConfirm */ > > + 0, /* runJavaScriptPrompt */ > > + 0, /* setStatusText */ > > + 0, /* mouseDidMoveOverElement */ > > + 0, /* missingPluginButtonClicked */ > > + 0, /* didNotHandleKeyEvent */ > > + 0, /* toolbarsAreVisible */ > > + 0, /* setToolbarsAreVisible */ > > + 0, /* menuBarIsVisible */ > > + 0, /* setMenuBarIsVisible */ > > Please line up the comments on these lines. :) Sure. > > Tools/MiniBrowser/gtk/main.c:43 > > +static void loadUri(const gchar *uri) > > Should be loadURI. Ok. > > Tools/MiniBrowser/gtk/main.c:57 > > + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URLâ¦]" }, > > Are there some extra characters at the end of "[URLâ¦]" Looks like a bug in review tool, it's utf-8 text, try opening the attachment.
Created attachment 89760 [details] Updated patch acording to review Patch updated to current git master, fixing the issues pointed out by martin and fixing a crash while opening a link in a new window from the context menu.
Comment on attachment 89760 [details] Updated patch acording to review View in context: https://bugs.webkit.org/attachment.cgi?id=89760&action=review Looks good, but please fix the style errors before landing. > Tools/MiniBrowser/gtk/BrowserWindow.c:406 > +static void browserWindowUIClientInit(BrowserWindow* window) Please shift the asterisk over. > Tools/MiniBrowser/gtk/main.c:32 > +static const gchar** uriArguments = NULL; The asterisks should be on uriArguments. > Tools/MiniBrowser/gtk/main.c:48 > + GtkWidget* mainWindow = browser_window_new(webView); > + gchar* url = argumentToURL(uri); > + WKPageLoadURL(WKViewGetPage(webView), WKURLCreateWithUTF8CString(url)); Ditto > Tools/MiniBrowser/gtk/main.c:66 > + GOptionContext* context = g_option_context_new(NULL); Ditto > Tools/MiniBrowser/gtk/main.c:70 > + GError* error = NULL; Ditto. Please use 0 here instead of NULL. > Tools/MiniBrowser/gtk/main.c:81 > + gint i; Please just use int here.
(In reply to comment #5) > (From update of attachment 89760 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=89760&action=review > > Looks good, but please fix the style errors before landing. > > > Tools/MiniBrowser/gtk/BrowserWindow.c:406 > > +static void browserWindowUIClientInit(BrowserWindow* window) > > Please shift the asterisk over. Ok, I thought the style was the same for non-C++ files, sorry. > > Tools/MiniBrowser/gtk/main.c:32 > > +static const gchar** uriArguments = NULL; > > The asterisks should be on uriArguments. > > > Tools/MiniBrowser/gtk/main.c:48 > > + GtkWidget* mainWindow = browser_window_new(webView); > > + gchar* url = argumentToURL(uri); > > + WKPageLoadURL(WKViewGetPage(webView), WKURLCreateWithUTF8CString(url)); > > Ditto > > > Tools/MiniBrowser/gtk/main.c:66 > > + GOptionContext* context = g_option_context_new(NULL); > > Ditto > > > Tools/MiniBrowser/gtk/main.c:70 > > + GError* error = NULL; > > Ditto. Please use 0 here instead of NULL. > > > Tools/MiniBrowser/gtk/main.c:81 > > + gint i; > > Please just use int here. Ok, Thanks. Note that this depends on uncommitted not yet approved patches, so I'll push it as soon as other patches are committed.
Committed r85313: <http://trac.webkit.org/changeset/85313>