[webkit-dev] WebKit Plugin Fallback, Registering for Image MIME Types

Simone Manganelli sim at stanford.edu
Thu Jul 2 21:42:26 PDT 2009


Hey all --

I'm one of the developers on the ClickToFlash project, a WebKit plugin  
that works to block Flash until the user specifically clicks on the  
view (I have it on good authority that some of you may already know of  
me or the project :) ).

Anyway, I was wondering about the feasibility/implementation of a  
couple of changes to plugin handling that would greatly help secure  
the future of ClickToFlash as well as making a bunch of us  
ClickToFlash devs secure in knowing that our efforts won't be for  
naught somewhere down the line.

First of all, it'd be great if there was a way to implement fallback  
to other plug-ins when handling content.  That is, ClickToFlash  
registers for the MIME type application/x-shockwave-flash, but then to  
get WebKit to fall back to the Flash plugin to finally display it, we  
have to do some DOM swizzling by changing the MIME type of the content  
to application/futuresplash.

Instead, it'd be better if there was an official way to do this.  I've  
filed a bug on the problem on Bugzilla ( https://bugs.webkit.org/show_bug.cgi?id=25540 
  ).  Mark Rowe suggested that a possible mechanism for accomplishing  
this would be for plug-ins to return nil in response to  
+plugInViewWithArguments: , which would then cause WebKit to search  
for another plug-in that can handle that content.  Is this a feasible  
method?  I'd appreciate any thoughts.  (I've downloaded the WebKit  
source myself and attempted to do a bit of patching myself, but didn't  
get too far, and besides, I have a lowly MacBook which screams out for  
mercy when compiling WebKit.)

On that note, I've also been exploring taking over control of the  
display of the image/gif MIME type, but what's puzzling is that it  
seems that WebKit handles this MIME type internally, regardless of  
whether another plug-in registers for it or not, even if I remove the  
QuickTime plugin entirely.  (I've filed a bug for this as well: https://bugs.webkit.org/show_bug.cgi?id=26946 
  .)  Is this a deliberate design decision not to allow other plug-ins  
to handle images that QuickTime handles?  I've tested this with image/ 
png and it produced a similar effect.  Is this an unchangeable policy,  
or is it feasible to allow plug-ins to handle these MIME types?

Any guidance would be greatly appreciated.  Thanks for your time.

-- Simone


More information about the webkit-dev mailing list