向 Qtwebkit 添加新的插件路径
我正在尝试扩展 qtwebkit 用于搜索插件的搜索路径。基本上我正在创建一个使用 QTBrowserPlugin 类设计的插件,我试图让我的浏览器使用 QTwebKit 编程来搜索我指定的文件夹中的插件,因为我不希望插件存储在Mozilla Firefox 插件目录或标准插件目录。
这可能吗?我可以让我的浏览器只查找我指定的目录,跳过所有标准目录。由于浏览器仅用于查看本地 html 页面。
I am trying to extend the search paths that qtwebkit uses to search for plugins. Basically I'm creating a plugin that is designed using the QTBrowserPlugin class and I am trying to make my browser which is programmeed using QTwebKit to search for the plugin in a folder specified by me as I don't want the plugin to be stored in the Mozilla Firefox plugins directory or the standard plugins directories.
Is this possible, and can I make my browser only look in the directory that I've specified, skipping all the standard directories. Since the browser will only be used to view locaL html pages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
QtWebKit 中似乎没有公共方法来执行此操作。
如果您愿意从源代码构建 QtWebKit,则可以向 QWebPage 添加一个调用
PluginDatabase::setPluginDirectories()
和PluginDatabase::refresh()
的方法。There does not seem to be a public method in QtWebKit for doing this.
If you're willing to build QtWebKit from source, you can add a method to QWebPage that calls
PluginDatabase::setPluginDirectories()
andPluginDatabase::refresh()
.我相信您可以为此目的设置环境变量 QTWEBKIT_PLUGIN_PATH 。
I believe you can set the environment variable QTWEBKIT_PLUGIN_PATH for this purpose.