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 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?
(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.
=== 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.