Difference between revisions of "Internet Plug-Ins"

From iPhone Development Wiki
Jump to: navigation, search
m (I guess no one uses /Library/Internet Plug-Ins anyway...)
(there's a quicktime plugin in there! retro)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''Internet Plug-Ins''' is a directory in <tt>/System/Library/</tt> and <tt>/Library/</tt> that contains plug-ins (like <del>Flash</del> and <del>Java</del>) for WebKit.  
+
'''Internet Plug-Ins''' is a directory in <tt>/System/Library/</tt> and <tt>/Library/</tt> that contains plug-ins for WebKit. As of iOS 6 and 7, the only default plugin there is QuickTime.
  
 
== Structure of an Internet Plug-In ==
 
== Structure of an Internet Plug-In ==
Internet plug-ins should have an extension of <tt>.webplugin</tt>. The principal class should be a subclass of [[UIView]] and adopts the [http://devworld.apple.com/mac/library/documentation/Cocoa/Reference/WebKit/Protocols/WebPlugInViewFactory_Protocol/Reference/Reference.html WebPlugInViewFactory] and [http://developer.apple.com/mac/library/documentation/Cocoa/Reference/WebKit/Protocols/WebPlugIn_Protocol/Reference/Reference.html WebPlugIn] protocols:
+
Internet plug-ins should have an extension of <tt>.webplugin</tt>. The principal class should be a subclass of [[UIView]] and adopts the [http://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Protocols/WebPlugInViewFactory_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40003833 WebPlugInViewFactory] and [http://developer.apple.com/mac/library/documentation/Cocoa/Reference/WebKit/Protocols/WebPlugIn_Protocol/Reference/Reference.html WebPlugIn] protocols:
 
<source lang="objc">
 
<source lang="objc">
 
@protocol WebPlugInViewFactory <NSObject>
 
@protocol WebPlugInViewFactory <NSObject>
Line 29: Line 29:
 
</source>
 
</source>
  
The <tt>Info.plist</tt> should contain some keys starting with <tt>WebPlugin…</tt>. See [http://devworld.apple.com/mac/library/documentation/InternetWeb/Conceptual/WebKit_PluginProgTopic/Concepts/AboutPlugins.html] for detail.
+
The <tt>Info.plist</tt> should contain some keys starting with <tt>WebPlugin…</tt>. See [http://developer.apple.com/legacy/library/documentation/InternetWeb/Conceptual/WebKit_PluginProgTopic/WebKitPluginTopics] for detail.
  
 
== References ==
 
== References ==
* [http://devworld.apple.com/mac/library/documentation/InternetWeb/Conceptual/WebKit_PluginProgTopic/WebKitPluginTopics.html Introduction to WebKit Plug-in Programming Topics] (on Mac OS X; should be similar on the iPhoneOS though).
+
* [http://developer.apple.com/legacy/library/documentation/InternetWeb/Conceptual/WebKit_PluginProgTopic/WebKitPluginTopics Introduction to WebKit Plug-in Programming Topics] (on Mac OS X; should be similar on iOS though).
  
 
{{Navbox Library}}
 
{{Navbox Library}}
 
[[Category:Directories in /System/Library]]
 
[[Category:Directories in /System/Library]]

Latest revision as of 21:46, 28 July 2014

Internet Plug-Ins is a directory in /System/Library/ and /Library/ that contains plug-ins for WebKit. As of iOS 6 and 7, the only default plugin there is QuickTime.

Structure of an Internet Plug-In

Internet plug-ins should have an extension of .webplugin. The principal class should be a subclass of UIView and adopts the WebPlugInViewFactory and WebPlugIn protocols:

@protocol WebPlugInViewFactory <NSObject>
-(UIView*)plugInViewWithArguments:(NSDictionary*)args;
@end

@protocol WebPlugIn
@optional
-(void)webPlugInInitialize;
-(void)webPlugInDestroy;
-(void)webPlugInStop;
-(void)webPlugInStart;

-(id)objectForWebScript;

-(void)webPlugInMainResourceDidFailWithError:(NSError*)error;
-(void)webPlugInMainResourceDidFinishLoading;
-(void)webPlugInMainResourceDidReceiveData:(NSData*)data;
-(void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse*)response;

// UIKit extras
-(BOOL)webPlugInReceivesEventsDirectly;   // inform UIKit that this plug-in should handle the events directly.
-(void)webPlugInLayout;   // similar to UIView's -layoutSubview
-(void)webPlugInDidDraw;  // similar to UIView's -drawRect:
@end

The Info.plist should contain some keys starting with WebPlugin…. See [1] for detail.

References