[webkit-help] Opening new webview's and IFrames

Arvin Bhatnagar arvinb at columbus.rr.com
Sun Apr 14 16:40:12 PDT 2013

The code is minimal:

@implementation AppDelegate

@synthesize tabSelection, tabs;

- (void) awakeFromNib {


    [self.webview setCustomUserAgent:kRegularAgent];

    NSURL *gmailURL = [NSURL

    NSURLRequest *request = [NSURLRequest requestWithURL:gmailURL];

    [[self.webview mainFrame] loadRequest:request];


- (void)applicationDidFinishLaunching:(NSNotification *)aNotification


    [self.webview setUIDelegate:self];



- (WebView *) webView:(WebView *)sender
createWebViewWithRequest:(NSURLRequest *)request {


    NSInteger newCount = self.tabs.numberOfTabViewItems;


    NSTabViewItem *tabItem = [[NSTabViewItem alloc]
initWithIdentifier:[NSString stringWithFormat:@"newtab%li", newCount]];

    tabItem.label = @"Tab";

    [self.tabs addTabViewItem:tabItem];

    self.tabSelection = newCount;


    WebView* newWebView = [[WebView alloc]

    [newWebView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];

    [tabItem.view addSubview:newWebView];

    [newWebView setPolicyDelegate:self];

    return newWebView;


- (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication
*)sender {

    return YES;



self.tabs is an IBOutlet to a generic NSTabView.


From:  Benjamin Poulain <benjamin at webkit.org>
Date:  Sunday, April 14, 2013 3:54 PM
To:  Arvin Bhatnagar <arvinb at columbus.rr.com>
Cc:  "webkit-help at lists.webkit.org" <webkit-help at lists.webkit.org>
Subject:  Re: [webkit-help] Opening new webview's and IFrames


On Sun, Apr 14, 2013 at 3:16 AM, Arvin Bhatnagar <arvinb at columbus.rr.com>
> Using WebKit/WebView I am opening a new web view when
> 'webView:createWebViewWithRequest:' is called. The image WebKit.jpg attached
> shows my results where the Iframe is not lining up. Other browsers using
> WebKit such as Chrome and Firefox are not exhibiting this same behavior
> (example attached as Chrome.jpg). I must be missing some flag or something
> very simple, but not sure exactly where to begin. Can someone please assist?

It could be a bug, it would be a good idea to file a new bug report on
bugs.webkit.org <http://bugs.webkit.org>  with all the informations.

More information about the webkit-help mailing list