Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Widget Plugin



On Apr 3, 2006, at 4:59 PM, Steven Woolley wrote:

Here is the code in my widget plugin:

-(id)initWithWebView:(WebView*)w {
	NSLog(@"Entering -initWithWebView:%@", w);
	[w setFrameLoadDelegate:self];
	self = [super init];
	return self;
}

This is not a good thing to do.

Taking over as the frame load delegate for the WebView you're inside is an inappropriate thing for a plug-in to do. Those APIs are for the object creating the WebView. As a plug-in implementer just a visitor in someone else's WebView (DashboardClient's, to be specific), so you should not overwrite the delegate with your own.

As a plug-in, you are already able to get at the host page's window object at the moment you're created. So even if wasn't a bad idea, it's too late to hook up a frame load delegate, the "window object available" message has already been sent.

    -- Darin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden
References: 
 >Widget Plugin (From: Steven Woolley <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.