Welcome guest, is this your first visit? Create Account now to join.
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

This is a discussion on Adapting NPAPI plugin for chrome within the Plugins Development section, part of the Chrome Plugins category: Hi, I whish to adapt an NPAPI plugin to work with google chrome on Windows. The plugin works in firefox ...


  1. #1
    Hansen is offline Junior Member
    Join Date
    Apr 2009
    Posts
    3

    Default Adapting NPAPI plugin for chrome

    Hi,

    I whish to adapt an NPAPI plugin to work with google chrome on Windows. The plugin works in firefox but when used in chrome I get an error dialog:

    "This application has failed to start because xpcom.dll was not found. Re-installing the application may fix this problem".

    And indeed, I link the program with with xpcom.lib from the gecko sdk. I need to do this because I need to call NS_GetMemoryManager. I need to call that function because I need to return a String from one of my scriptable functions (the shorthand NS_Alloc will also do for me).

    Also, loading in xpcom.dll with LoadLibrary does not seem to work.

    Any suggestion or pointers of how to make the plugin work with chrome?

    Hansen

  2. #2
    Kyrax is offline Senior Member
    Join Date
    Apr 2009
    Location
    Qc, Canada
    Posts
    495

    Default

    I am not very familiar with NPAPI plugins but i suppose that you tried to load it using a manifest ? something like that :

    {
    "format_version": 1,
    "id": "00123456789ABCDEF0123456789ABCDEF0123456",
    "version": "1.0",
    "name": "My First Extension",
    "description": "The first extension that I made.",
    "plugins_dir": "plugins"
    }

    and then starting Chrome with --enable-extensions --load-extension="c:\myextension" where "C:\myextension" is the path to your manifest.

    I'm pretty sure this is the standard way to load NPAPI plugins in Chrome. I'm not sure if you can access the gecko SDK using that technique however.

    I wish i could be more helpful,

    Kyrax

  3. #3
    Hansen is offline Junior Member
    Join Date
    Apr 2009
    Posts
    3

    Default

    Hi Kyrax

    Thanks for your reply, but I think you may be talking about a different kind of plugin than I do.

    During installation of our application, we copy the plugin to the user profile under the subdirectory Application Data\Mozilla\plugins. In firefox, this allows the plugin to be started from a webpage using the "embed" html tag. The plugin can then be accessed from javascript on that page. Actually, the only purpose of our plugin is to make functions available to javascript.

    When copied to the location just specified, Chrome also recognizes the plugin and you can see it if you type "about:plugins" in the address bar. The trouble comes when a webpage tries to access the plugin. Actually, if I don't link the plugin with xpcom.lib and instead load "xpcom.dll" in with LoadLibrary, things seem to work well to the extend that chrome at least tries to initialize the plugin by calling the function NP_Initialize in the plugin as it is supposed to do. However, the call LoadLibrary("xpcom.dll") fails.

  4. #4
    Kyrax is offline Senior Member
    Join Date
    Apr 2009
    Location
    Qc, Canada
    Posts
    495

    Default

    I see,

    Well at least you can see it with "about: plugins" so i guess you are on the right path.

    However, my answer was based on http://dev.chromium.org/developers/d...-NPAPI-Plugins .. you should check it out, they definitely mention using a manifest.json in order to initialise the NPAPI plugin.

    Now that i think of it however, this is probably meant to be used if you plan on using your NPAPI plugin in your javascript extension. This might be one way to do it. Using an extension defined for your webpage where you would use the "embed" html tag.

    Good luck !

    Kyrax

  5. #5
    Hansen is offline Junior Member
    Join Date
    Apr 2009
    Posts
    3

    Default

    Ok, I did some further investigations. It seems like there are two ways to make scriptable npapi plugins: The old way using xpcom and the new way using npruntime. And chrome seems to only support the new way while I use the old way.

    I am not completely sure about this, as I am not an expert on this subject. Anyway, using the npruntime method seems to be the way to go for me.

    Thanks for your help.

  6. #6
    Lex1 is offline Member
    Join Date
    Jan 2009
    Posts
    67

    Default

    It works in other browsers (Opera, for instance)? If yes - write bug-report.

  7. #7
    priyasivasamu is offline Junior Member
    Join Date
    Jun 2009
    Posts
    4

    Default

    I have our company's own plugins. When I copy the dlls and xpts to Plugins folder in Chrome->Application->Plugins folder, I am able to see the plugins in "Aboutlugins". But when I try to invoke methods of the plugins, I am getting error message
    "---------------------------
    chrome.exe - Unable To Locate Component
    ---------------------------
    This application has failed to start because xpcom.dll was not found. Re-installing the application may fix this problem.
    ---------------------------
    OK
    ---------------------------

    These Plugins call the Active X controls internally.


    Now, I copied few dlls like xpcom.dll etc from Mozilla directory.

    After that, when I include <EMBED tag>, I am able to see the value of the <EMBED? tag, but, when I try to invoke the APIs from the plugins, it gives error <obj> has no properties.

    Does Google chrome has an equivalent of XPIs. Does Google Chrome support NPAPIs at all?

  8. #8
    Kyrax is offline Senior Member
    Join Date
    Apr 2009
    Location
    Qc, Canada
    Posts
    495

    Default

    As I linked earlier, Chrome supports NPAPI plugins. I might be wrong, but isn't Flash, Quicktime and the like NPAPI plugins ?

    These Plugins call the Active X controls internally.
    I don't know much about this but.. isn't ActiveX a IE thing ?

    Just trying to understand the whole problem here.

  9. #9
    priyasivasamu is offline Junior Member
    Join Date
    Jun 2009
    Posts
    4

    Default

    Kyrax,


    Yes. Flash is a NPAPI plugin. They create an entry for these plugins in the registry in "Mozilla Plugins". They do not copy the plugins into "Plugins" directory in Google chrome. They keep the plugins and the ocx file somewhere in system32.

    I don't know how their plugin is working. Becase for Flash plugins it doesn't flash the error message I mentioned earlier. Without copying xpcom.dll and others, it is working fine.

    But, our companies plugins are not working. They are working properly on Firefox, netscape, seamonkey and Flock.

    I need a solution for CHrome as soon as possible as it is incresingly becoming popular.

    Can u also tell me if I had to use <object> tag outside <embed> tag. Because in few forums I saw that. I have posted in query in chromium site as well. But no response till now.

  10. #10
    priyasivasamu is offline Junior Member
    Join Date
    Jun 2009
    Posts
    4

    Default

    And yes, Active-X is a IE thing. Thats why to use these active-x, we have plugins.
    The plug ins generally has dll or ocx and xpt. These components call the active-x components internally.

Page 1 of 2 12 LastLast

Similar Threads

  1. DownloadHelper Plugin for Chrome ?
    By Boomdoom in forum Plugins Troubleshooting
    Replies: 31
    Last Post: 05-22-2014, 02:34 AM
  2. java plugin for chrome
    By swth in forum Chrome Troubleshooting
    Replies: 2
    Last Post: 04-17-2009, 06:29 PM
  3. Delicious Plugin To Google's Chrome Browser
    By IDEVFH in forum Chrome Plugins
    Replies: 0
    Last Post: 02-26-2009, 12:48 AM
  4. Chrome plugin for Google Toolbar Bookmarks
    By digitron in forum Chrome Plugins
    Replies: 0
    Last Post: 11-17-2008, 08:13 PM
  5. Open in chrome ff plugin help
    By Qinhas in forum Chrome Talk
    Replies: 4
    Last Post: 10-03-2008, 04:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •