Bug 11622 - Quicktime plugin getting returned for flash content
Summary: Quicktime plugin getting returned for flash content
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-16 16:40 PST by Steve Gehrman
Modified: 2022-06-30 13:46 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Gehrman 2006-11-16 16:40:55 PST
WebPluginDatabase.m 

WebKit randomly returns Quicktime plugin for flash content (could effect any plugin, but flash for sure)

Depending on which order the plugins are found, Quicktime can be returned instead of Flash Player.

See the // ## lines below for the additions I added.  The problem is if Quicktime is found first, flash isn't used.

- (WebBasePluginPackage *)pluginForKey:(NSString *)key withEnumeratorSelector:(SEL)enumeratorSelector
{
    WebBasePluginPackage *plugin, *CFMPlugin=nil, *machoPlugin=nil, *webPlugin=nil;
    NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
    key = [key lowercaseString];

    while ((plugin = [pluginEnumerator nextObject]) != nil) {
        if ([[[plugin performSelector:enumeratorSelector] allObjects] containsObject:key]) {
            if ([plugin isKindOfClass:[WebPluginPackage class]]) {
                
                // ### added the || [webPlugin isQuickTimePlugIn]
                if (!webPlugin || [webPlugin isQuickTimePlugIn])
                    webPlugin = plugin;
                
            } else if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) {
                WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType];
                if (executableType == WebCFMExecutableType) {
                    
                    // ### added the || [CFMPlugin isQuickTimePlugIn]
                    if (!CFMPlugin || [CFMPlugin isQuickTimePlugIn])
                        CFMPlugin = plugin;
                    
                } else if (executableType == WebMachOExecutableType) {
                    
                    // ### added the || [machoPlugin isQuickTimePlugIn]
                    if (!machoPlugin || [machoPlugin isQuickTimePlugIn])
                        machoPlugin = plugin;
                    
                } else {
                    ASSERT_NOT_REACHED();
                }
            } else {
                ASSERT_NOT_REACHED();
            }
        }
    }
        
    // Allow other plug-ins to win over QT because if the user has installed a plug-in that can handle a type
    // that the QT plug-in can handle, they probably intended to override QT.
    if (webPlugin && ![webPlugin isQuickTimePlugIn])
        return webPlugin;
    else if (machoPlugin && ![machoPlugin isQuickTimePlugIn])
        return machoPlugin;
    else if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn])
        return CFMPlugin;
    else if (webPlugin)
        return webPlugin;
    else if (machoPlugin)
        return machoPlugin;
    else if (CFMPlugin)
        return CFMPlugin;
    return nil;
}
Comment 1 Mark Rowe (bdash) 2006-11-16 16:48:49 PST
Steve, please see http://webkit.org/coding/contributing.html for information about how to contribute fixes to the code.  Pasting code into the description of a bug is not likely to get it committed to the tree.
Comment 2 Steve Gehrman 2006-11-16 17:25:26 PST
I guess this is why WebKit is so buggy.  And you wonder why people don't want to submit bugs?  It would take someone less than 30 seconds to update the code.  I didn't read that link and don't plan on reading it :)
Comment 3 Mark Rowe (bdash) 2006-11-16 17:58:27 PST
Thanks for your continued support Steve.
Comment 4 Mark Rowe (bdash) 2006-11-17 14:10:47 PST
CCing Tim Omernick as he appears to be the plugin guru.
Comment 5 Derk-Jan Hartman 2007-08-10 13:28:51 PDT
As having worked on the VLC plugin, personally I think it would be better if there was configurability of the prioritizing of plugins. If you have 5 plugins handling the same stuff, you have absolutely no idea which plugin is gonna handle your material unless forced by the HTML. Being able to configure this (albeit trough a preference file without a GUI), would be very helpful.

P.S. We have seen similar behaviour in VLC plugin development, with an apparent bias for plugins with a more recent modification time.

Comment 6 Ahmad Saleem 2022-06-30 13:07:14 PDT
I think something along these lines was implemented as in following:

**Webkit Legacy - WebPluginDatabase.m**

https://github.com/WebKit/WebKit/blob/429b498267a320854edc566001dde39c2f5af0d0/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm#L117

I was not able to find "Webkit" source.

I think since it was implemented with approach of "Best candidtate" in Webkit Legacy and now removed from Webkit2 etc., I think this can be marked as "RESOLVED WORKSFORME" or "RESOLVED INVALID" etc.

Just wanted to update. Thanks!