Developing Chrome Extensions Using NPAPI in C++

后端 未结 2 1188
太阳男子
太阳男子 2021-02-04 19:35

I want to develop a simple Chrome extension in C++, using NPAPI, which does the job of dumping the HTML content of the current page onto a file. I don\'t have much expertise in

2条回答
  •  庸人自扰
    2021-02-04 20:11

    There's a plugin here that will help you....
    http://code.google.com/p/npapi-file-io/
    ...source is there aswell. This plugin will allow you to write a string (your html) to a file plus a few other nice things. Windows and Linux only unfortunately.
    Then all you need to do is write a script to dump what you want.

    As smorgan points out in the comments these sort of plugins have the potential to be rather dangerous.
    So make sure when you add the plugin to your manifest that you set the public property to false...
    http://code.google.com/chrome/extensions/npapi.html

     "plugins": [
        { "path": "plugin.dll", "public": false }
      ]
    

    And in the future (Chrome 18) you should use manifest version 2...
    http://code.google.com/chrome/extensions/trunk/manifestVersion.html

    Also, I take it that you want to save the file without any user input. If that isnt true and having a dialog to select where to save the file every time is acceptable then this can be done without using a plugin.

提交回复
热议问题