Bug 29706 - [Qt] Allow excluding certain plugins from loading
Summary: [Qt] Allow excluding certain plugins from loading
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P4 Enhancement
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2009-09-24 01:50 PDT by Marius Renn
Modified: 2014-02-03 03:13 PST (History)
3 users (show)

See Also:


Attachments
Qt patch to allow overriding plugin loading (5.99 KB, patch)
2009-09-24 01:50 PDT, Marius Renn
hausmann: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marius Renn 2009-09-24 01:50:25 PDT
Created attachment 40052 [details]
Qt patch to allow overriding plugin loading

I have extended the plugin load delegation functionality described in bug 28677 (https://bugs.webkit.org/show_bug.cgi?id=28677) to the Qt API layer, where I have added two virtual methods shouldLoadPluginAtPath() and shouldLoadPluginWithInfo() to the QWebPluginDatabase class. These allow subclasses to make decisions on which plugins to load without altering the plugin directory. As plugins may execute code when they are loaded, it may be desirable to exclude certain plugins which are known to cause problems with the client application. While the default implementation of these two additional methods simply returns true, a subclass may do something more sophisticated (such as excluding certain plugins).
Comment 1 Simon Hausmann 2009-09-25 04:18:03 PDT
Comment on attachment 40052 [details]
Qt patch to allow overriding plugin loading

I'm sorry, this doesn't look right.

QWebPluginDatabase has a private constructor and is a singleton accessed through QWebSettings. It is not designed for
sub-classing, so adding virtual functions won't work.

Why is QWebPluginInfo's setEnabled not sufficient for your use-case?
Comment 2 Marius Renn 2009-09-26 06:07:42 PDT
(In reply to comment #1)
> (From update of attachment 40052 [details])
> I'm sorry, this doesn't look right.
> 
> QWebPluginDatabase has a private constructor and is a singleton accessed
> through QWebSettings. It is not designed for
> sub-classing, so adding virtual functions won't work.
> 
> Why is QWebPluginInfo's setEnabled not sufficient for your use-case?

You are right of course. (Actually, the patch we are currently using locally makes use of a "delegate" object, which allows subclassers to implement the shouldLoadPlugin... methods. I mistakenly thought it would be easier to move these methods into the QWebPluginDatabase class).

Anyway, the reason we require such functionality is because we have been getting crash reports of our app crashing during launch time. We have tracked it down to certain plugins causing the crash when they are loaded. Unfortunately, using QWebPluginInfo's setEnabled does not help as the plugin may have already executed code before that (for instance, the implementation of fetchInfo() on the Mac may execute code from the plugin). Please feel free to correct me though if I misunderstand things.

I would like to know whether the Qt team deem such functionality useful. If so, my suggestion would be to provide a callback interface for plugin loading. An implementation could be set using a method setPluginLoadingDelegate() on QWebPluginInfo. Please let me know what you think.
Comment 3 Jocelyn Turcotte 2014-02-03 03:13:05 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.