Complex example on Windows

27 views
Skip to first unread message

Peter Sinnott

unread,
Oct 14, 2009, 8:01:54 AM10/14/09
to nixysa-users
Hi,

With a few minor tweaks I can get the solution to build but Firefox is
not picking it up in about:plugins.
Any suggestions as to why it may not be picked up?

Thanks
Peter

Browser : Firefox 3.5.3
IDE : Visual C++ 2008 Express Edition
OS : Windows XP Service Pack 2

Antoine Labour

unread,
Oct 14, 2009, 1:33:30 PM10/14/09
to nixysa...@googlegroups.com
On Wed, Oct 14, 2009 at 5:01 AM, Peter Sinnott <psin...@gmail.com> wrote:

Hi,

With a few minor tweaks I can get the solution to build but Firefox is
not picking it up in about:plugins.
Any suggestions as to why it may not be picked up?

Which minor tweaks did you need to do ?

Couple of things to check:
- did the plugin correctly get installed into Firefox's plugin directory ?
- did you restart your browser ?

Antoine

Peter Sinnott

unread,
Oct 14, 2009, 4:37:43 PM10/14/09
to nixysa-users


On Oct 14, 6:33 pm, Antoine Labour <pi...@google.com> wrote:
> On Wed, Oct 14, 2009 at 5:01 AM, Peter Sinnott <psinn...@gmail.com> wrote:
>
> > Hi,
>
> > With a few minor tweaks I can get the solution to build but Firefox is
> > not picking it up in about:plugins.
> > Any suggestions as to why it may not be picked up?
>
> Which minor tweaks did you need to do ?

When attempting to build with scons I needed to update common.cc to
include stdio.h instead of defining snprintf since it was picking up
gcc as the compiler.
When building with visual studio I needed to replace the include of
afxres.h with windows.h in complex.rc.

>
> Couple of things to check:
> - did the plugin correctly get installed into Firefox's plugin directory ?
> - did you restart your browser ?

The dll got copied to the plugin directory and I did manually copy it
to every plugin directory I could find a few times.
I restarted my browser many many times. Even tried installing a few
different Firefox versions.


After a bit more trial and error it seems if I open the project file
first it works but if I open the solutions file it doesn't.
As my version of visual studio is more recent that one used to create
the project both files are upgraded when I open them.
I have never used Visual Studio before so I am a bit vague on the
difference between a solution and a project. Should it matter which
file I open to access the project?



Thanks
Peter

Antoine Labour

unread,
Oct 14, 2009, 4:46:58 PM10/14/09
to nixysa...@googlegroups.com
On Wed, Oct 14, 2009 at 1:37 PM, Peter Sinnott <psin...@gmail.com> wrote:



On Oct 14, 6:33 pm, Antoine Labour <pi...@google.com> wrote:
> On Wed, Oct 14, 2009 at 5:01 AM, Peter Sinnott <psinn...@gmail.com> wrote:
>
> > Hi,
>
> > With a few minor tweaks I can get the solution to build but Firefox is
> > not picking it up in about:plugins.
> > Any suggestions as to why it may not be picked up?
>
> Which minor tweaks did you need to do ?

When attempting to build with scons I needed to update common.cc to
include stdio.h instead of defining snprintf since it was picking up
gcc as the compiler.

Ah, for one, the scons build is busted on windows (it doesn't produce a DLL with all the right stuff in it) - I've been intending to fix that, but for now please use the solution.

When building with visual studio I needed to replace the include of
afxres.h with windows.h in complex.rc.

I see, that's probably because the EE version of VS doesn't include that file.
I'm wondering if that has any impact on the generated .res that could explain problems... We shouldn't need anything fancy from that file, so we should be able to fix that.


>
> Couple of things to check:
> - did the plugin correctly get installed into Firefox's plugin directory ?
> - did you restart your browser ?

The dll got copied to the plugin directory and I did manually copy it
to every plugin directory I could find a few times.
I restarted my browser many many times. Even tried installing a few
different Firefox versions.


After a bit more trial and error it seems if I open the project file
first it works but if I open the solutions file it doesn't.
As my version of visual studio is more recent that one used to create
the project both files are upgraded when I open them.
I have never used Visual Studio before so I am a bit vague on the
difference between a solution and a project. Should it matter which
file I open to access the project?

I'd think not.
A solution is like a collection of projects with information about the dependencies between them. The only thing may be that the default project in the solution doesn't build the right thing ?

Antoine

Sergey Kurdakov

unread,
Oct 24, 2009, 3:59:30 PM10/24/09
to nixysa-users
Hi

I started to learn nixysa and managed to run Complex example under
Firefox.

However it won't run in chrome ( I managed to install it though).

Does anyone has it running in chrome - any hints?

Regards
Sergey

Antoine Labour

unread,
Oct 24, 2009, 5:11:22 PM10/24/09
to nixysa...@googlegroups.com
It should run similarly in Chrome and Firefox.
Which platform is it (Windows ? Linux ?)
Does the complex plugin show up in about:plugins ?

Antoine

Sergey Kurdakov

unread,
Oct 24, 2009, 5:22:54 PM10/24/09
to nixysa...@googlegroups.com
Hi Antoine

>Which platform is it (Windows ? Linux ?)

 windows


>Does the complex plugin show up in about:plugins ?

it does not shows in about:plugins but shows up in chrome://extensions/

I followed http://code.google.com/chrome/extensions/npapi.html and
http://code.google.com/chrome/extensions/packaging.html

to prepare crx installation file. Was it  wrong way?

Regards
Sergey

Antoine Labour

unread,
Oct 24, 2009, 6:37:10 PM10/24/09
to nixysa...@googlegroups.com
On Sat, Oct 24, 2009 at 2:22 PM, Sergey Kurdakov <sergey...@gmail.com> wrote:
Hi Antoine

>Which platform is it (Windows ? Linux ?)

 windows


>Does the complex plugin show up in about:plugins ?

it does not shows in about:plugins but shows up in chrome://extensions/

I followed http://code.google.com/chrome/extensions/npapi.html and
http://code.google.com/chrome/extensions/packaging.html

to prepare crx installation file. Was it  wrong way?

It is incorrect. Plugins and extensions are really different. Extensions can use plugins to add native code capability, but it is a separate feature. The test page expects the plugin to be installed like a regular plugin, like Flash.
Installing the plugin the same way it is for Firefox (e.g. copying it to Firefox's plugins directory) should be enough to make it work in Chrome (it looks for plugins in Firefox's plugins directory, among others).

Antoine

Sergey Kurdakov

unread,
Oct 25, 2009, 11:04:37 AM10/25/09
to nixysa...@googlegroups.com
Hi Antoine,

so


>Installing the plugin the same way it is for Firefox (e.g. copying it to Firefox's plugins directory) should be enough to make it work in Chrome (it looks for plugins in Firefox's plugins directory, among others).

it works just fine in FireFox but not in Chrome ( it appears as plugin ( extentions tab) in Firefox and is situated in plugins folder ).
FireFox puts at extension tabs - automatically if rdf ( see below ) and dll are included in xpi

so following links for developers of plugins

https://developer.mozilla.org/en/Plugins
we get to
Shipping a plugin as an extension
link
and actually no other information ( on developing plugins )

so - you may notice that for beginner this looks - that in order to start simple thing - there is no place to see. There is quite a bit of information on extensions - and no information how example code could be installed as a plugin

so if you know , could you please give a link on how to exactly package compiled dll so that it started to work as 'Addon'.

===
I use following rdf file for FireFox ( and it works fine )

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">

    <Description about="urn:mozilla:install-manifest">

        <em:id>***@*****.org</em:id>
        <em:name>Nixysa complex sample plugin</em:name>
        <em:version>0,0,0,1</em:version>

        <!-- Target Application this extension can install into,
             with minimum and maximum supported versions -->
        <em:targetApplication>

            <Description>
                <!-- Firefox -->
                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                <em:minVersion>3.0</em:minVersion>
                <em:maxVersion>3.*</em:maxVersion>
            </Description>

        </em:targetApplication>

    </Description>

</RDF>

===
Best regards
Sergey

On Sun, Oct 25, 2009 at 1:37 AM, Antoine Labour wrote:


Antoine Labour

unread,
Oct 25, 2009, 5:52:08 PM10/25/09
to nixysa...@googlegroups.com
On Sun, Oct 25, 2009 at 8:04 AM, Sergey Kurdakov <sergey...@gmail.com> wrote:
Hi Antoine,

so


>Installing the plugin the same way it is for Firefox (e.g. copying it to Firefox's plugins directory) should be enough to make it work in Chrome (it looks for plugins in Firefox's plugins directory, among others).

it works just fine in FireFox but not in Chrome ( it appears as plugin ( extentions tab) in Firefox and is situated in plugins folder ).
FireFox puts at extension tabs - automatically if rdf ( see below ) and dll are included in xpi

so following links for developers of plugins

https://developer.mozilla.org/en/Plugins
we get to
Shipping a plugin as an extension
link
and actually no other information ( on developing plugins )

so - you may notice that for beginner this looks - that in order to start simple thing - there is no place to see. There is quite a bit of information on extensions - and no information how example code could be installed as a plugin

so if you know , could you please give a link on how to exactly package compiled dll so that it started to work as 'Addon'.


In any case, I believe the Visual Studio solution installs the plugin at the right place - is that what you used to build the sample ? Then again I only tried on Windows XP, so maybe there is a problem on other versions.

In a nutshell, the solution will build a file named npcomplex.dll. You can just copy it to "c:\Program Files\Mozilla Firefox\plugins" (or wherever Firefox is installed), restart Chrome, and that should work.

Antoine
Reply all
Reply to author
Forward
0 new messages