返回介绍

Qt-based LiveConnect Plugins

发布于 2019-10-04 14:58:08 字数 2732 浏览 927 评论 0 收藏 0

The Qt-based Netscape Plugin software makes it easy to write plugins
that can be used on both Unix/Linux and Windows/95/NT, in Netscape and
Internet Explorer, and any other web browser supporting the same
protocol.

How-to

  1. Download the
    Plugin SDK from Netscape, and copy the following files from there to
    $QTDIR/extensions/nsplugin/src

    • common/npwin.cpp
    • common/npunix.c
    • include/npapi.h
    • include/npupp.h
    • include/jri.h
    • include/jri_md.h
    • include/jritypes.h
  2. Build the Netscape Plugin extension library, found in the
    extensions/nsplugin/src directory of your Qt distribution.
    This produces a static library to be linked with your plugin code.

  3. Read the plugin class documentation, and
    examine the example plugins.

  4. Do most of your development as a stand-alone Qt application - debugging
    Netscape Plugins is cumbersome. You may want to use signal(2)
    in your plugin to enable core-dumps if your browser disables them.

  5. Note the platform-specific build steps below.
  6. Read about the raw plugin interface
    in Netscape's handbook.

  7. If files viewed by a plugin are provided by an HTTP server
    (using a http://... URL) then
    the server must be configured to send the correct MIME type
    for the file, e.g. by editing Apache's mime.types file.
    If the files are viewed via a //...
    URL, then the browser will use the filename extension to decide
    the file type (and hence the plugin to load) - the user may need
    to set the filename extension in the Helpers or Applications
    section of their browser preferences.

Building under X11

  • The Makefiles in the examples are appropriate for UNIX/X11.
  • The user must install the resulting Shared Object in the Plugins
    directory of the browser.

Building under Windows

  • Qt needs to be built as a static library when building Netscape
    plugins.

  • Plugins must be named npname.dll,
    or the browser will ignore them.

  • The link step must include:
    • /def:name.def
    • /dll
    • a compiled resource file defining the
      file/MIME types accepted by the plugin.
  • The user must install the resulting DLL in the Plugins directory
    of the browser.

Known Bugs

The Qt-based LiveConnect Plugin binding code has a number of
minor bugs, but is sufficiently stable for many production applications.

  • MSIE 4.0 support is poor.
  • Crashes on X11 if window is closed via window manager.
  • Keyboard problems on Windows.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文