Firefox extension doesn't work with FF4

Bug #709103 reported by Artem on 2011-01-28
54
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Zeitgeist Data-Sources
High
Manish Sinha (मनीष सिन्हा)

Bug Description

When installed and up it shows alert box
"TypeError: Components.classes['@zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1'] is undefined"
and does so every time new window is opened.

Also previous FF4 betas were affected.

And what does that mean exactly? I'm not able to see what goes wrong, I only see that it doesn't work. Is this fixable for an end-user?

Artem (leipreachan) wrote :

Err.. The API has changed. What should I say? The extension is unable to send notifications to zeitgeist. Still.

Mmh... any chance to get a working firefox-provider? Since I've changed from chromium to firefox4, Zeitgeist is the only thing I'm really missing. Is someone having an eye on this?

Artem (leipreachan) wrote :

That's ridiculous. No one of developers even take a look on this for three months.
Guys, do you listen the users?

We are on it... Problem is that we are busy releasing 0.8 series. I will
have a look at it today

On Tue, Mar 15, 2011 at 9:53 AM, tricote <email address hidden> wrote:

> That's ridiculous. No one of developers even take a look on this for three
> months.
> Guys, do you listen the users?
>
> --
> You received this bug notification because you are subscribed to The
> Zeitgeist Project.
> https://bugs.launchpad.net/bugs/709103
>
> Title:
> Firefox extension doesn't work with FF4b10
>
> Status in Zeitgeist Data-Sources:
> New
>
> Bug description:
> When installed and up it shows alert box
> "TypeError: Components.classes['@
> zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1'] is undefined"
> and does so every time new window is opened.
>
> Also previous FF4 betas were affected.
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

This incompatibility issue persists into Firefox 4 RC1 (No surprise).

It seems to me that it would be desirable to have this fixed before the final release of Firefox 4, which is scheduled for 22 March 2011 (see https://wiki.mozilla.org/Releases).

Artem (leipreachan) wrote :

Any ideas when we see the updated extension?
In my opinion we don't need Zeitgeist without dataproviders...

summary: - Firefox extension doesn't work with FF4b10
+ Firefox extension doesn't work with FF4

Jon Nettleton aka jnettlet provided a patch

Requirement is to export CXXFLAGS="-DMOZ_NO_MOZALLOC" before running autogen.sh or configure

this should added in autobuild script

I tried building after applying this patch.
First you need to download and install Firefox 4, For ubuntu it is as simple as
askubuntu.com/questions/6339/how-do-i-install-firefox-4
Install the package firefox and firefox-dev from this PPA

The error I get is

make[3]: Entering directory `/home/manish/code/zeitgeist-dataproviders/firefox-libzg/extension/components'
  CXX libzeitgeist_xpcom_la-ZeitgeistComponent.lo
ZeitgeistComponent.cpp:23: fatal error: mozilla/ModuleUtils.h: No such file or directory
compilation terminated.

These header files are present in the package firefox-dev

The reason is that the file ModuleUtils.h is present in /usr/share/firefox-4.0/mozilla/ModuleUtils.h

Now I edit the file ZeitgeistComponent.cpp to
- #include "mozilla/ModuleUtils.h"
+ #include "firefox-4.0/mozilla/ModuleUtils.h"'

and the error I get is

make[3]: Entering directory `/home/manish/code/zeitgeist-dataproviders/firefox-libzg/extension/components'
  CXX libzeitgeist_xpcom_la-ZeitgeistComponent.lo
In file included from ZeitgeistComponent.cpp:23:
/usr/include/firefox-4.0/mozilla/ModuleUtils.h:42: fatal error: mozilla/Module.h: No such file or directory
compilation terminated.

This header file includes a file named Module.h

#include "mozilla/Module.h" in line 42
This file is contained at
 /usr/share/firefox-4.0/mozilla/Module.h

I am confused. How to fix this to make the compiler look in some specific directory

Changed in zeitgeist-dataproviders:
assignee: nobody → Markus Korn (thekorn)

Assigning it to Markus as from the copyright, it looks like he is the original author

Changed in zeitgeist-dataproviders:
status: New → Confirmed
importance: Undecided → High
Download full text (3.2 KiB)

I tried this on natty Beta 2 with Firefox4 and xulrunner-2.0-dev

Applied the patch and got this error, not able to make out what needs to be done

make[4]: Entering directory `/home/manish/code/zeitgeist-dataproviders/firefox-libzg/extension/components'
  CXX libzeitgeist_xpcom_la-ZeitgeistComponent.lo
In file included from /usr/include/xulrunner-2.0/nscore.h:50:0,
                 from /usr/include/xulrunner-2.0/mozilla/Module.h:41,
                 from /usr/include/xulrunner-2.0/mozilla/ModuleUtils.h:42,
                 from ZeitgeistComponent.cpp:23:
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:109:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:113:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:117:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:120:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:124:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:127:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:131:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:134:5: error: expected initializer before ‘NS_ATTR_MALLOC’
/usr/include/xulrunner-2.0/mozilla/mozalloc.h: In function ‘void* operator new(size_t)’:
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:229:28: error: ‘moz_xmalloc’ was not declared in this scope
/usr/include/xulrunner-2.0/mozilla/mozalloc.h: In function ‘void* operator new(size_t, const std::nothrow_t&)’:
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:235:27: error: ‘moz_malloc’ was not declared in this scope
/usr/include/xulrunner-2.0/mozilla/mozalloc.h: In function ‘void* operator new [](size_t)’:
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:241:28: error: ‘moz_xmalloc’ was not declared in this scope
/usr/include/xulrunner-2.0/mozilla/mozalloc.h: In function ‘void* operator new [](size_t, const std::nothrow_t&)’:
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:247:27: error: ‘moz_malloc’ was not declared in this scope
/usr/include/xulrunner-2.0/mozilla/mozalloc.h: In function ‘void* operator new(size_t, const mozilla::fallible_t&)’:
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:303:27: error: ‘moz_malloc’ was not declared in this scope
/usr/include/xulrunner-2.0/mozilla/mozalloc.h: In function ‘void* operator new [](size_t, const mozilla::fallible_t&)’:
/usr/include/xulrunner-2.0/mozilla/mozalloc.h:309:27: error: ‘moz_malloc’ was not declared in this scope
make[4]: *** [libzeitgeist_xpcom_la-ZeitgeistComponent.lo] Error 1
make[4]: Leaving directory `/home/manish/code/zeitgeist-dataproviders/firefox-libzg/extension/components'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/manish/code/zeitgeist-dataproviders/firefox-libzg/extension/components'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/manish/code/zeitgeist-dataproviders/firefox-libzg/extension'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/manish/...

Read more...

I got this to *compile* at least with the help of this.. http://code.google.com/p/gecko-mediaplayer/source/detail?r=407
I simply hacked -DMOZ_NO_MOZALLOC into the proper makefiles...
 It builds, but note that it doesn't *work*...when firefox is launched it simply says this plugin is not compatible with ff4
 err, extension
 here is the ticket if it helps http://code.google.com/p/gecko-mediaplayer/issues/detail?id=109
 I also saw this solution.. http://forums.mozillazine.org/viewtopic.php?f=42&t=1988033
 hope this helps :)

Hey thansen,
I managed to get that environment variable in the build script somehow. The patch is attached
I still get the error that it is not compatible with Firefix 4.0

The solution was adding
+ AC_DEFINE(MOZ_NO_MOZALLOC, ["For Mozilla Firefox 4"])

in configure.ac

Still not sure how to make it compatible with Firefox 4

More progress. Finally I managed to build it

- <em:minVersion>3.5</em:minVersion>
- <em:maxVersion>3.6.*</em:maxVersion>
+ <em:minVersion>4.0</em:minVersion>
+ <em:maxVersion>4.0.*</em:maxVersion>

in firefox-libzg/extension/install.rdf

But still get a TypeError

This is the error I get now after restarting firefox

Mark Tully (markjtully) wrote :

There seems to be another change in the way extensions work in Firefox 4. Before version 4, extensions used to be automatically unpacked to a directory on restart if you put the .xpi in the extensions folder. Now they don't have to be - the .xpi on its own is sufficient. Unless the extension contain binary components, like this one. A new <en:unpack>true</em:unpack> needs to be added to the install.rdf file for this to be done, but it only appears to be done on installation through Firefox (not if you just copy it to the directory)

Hopefully, the enclosed patch will work. make local-install should install it as an unpacked directory rather than an .xpi to the extensions folder. (Presumably it would conflict with an .xpi of the same extension already there, though, so that may need to be manually deleted if it exists)

Changed in zeitgeist-dataproviders:
assignee: Markus Korn (thekorn) → Manish Sinha (मनीष सिन्हा) (manishsinha)
milestone: none → 0.8.0
Changed in zeitgeist-dataproviders:
status: Confirmed → Fix Committed
Artem (leipreachan) wrote :

Guys, thanks for work.
Compiled it from the source and it works like a charm.

One small issue about this extension is its version. Currently it is 0.1 but the previous one was 0.2. And because of this (maybe) it can be installed next to the old version.

Anyway, thanks for you work.

Hmm. Thanks for the update. Will bump the version number

Everything is done. Bumped the version number.

tricote,
If you have Firefox 3.6 installed, can you check the 3.6 dataprovider too?
https://code.launchpad.net/~manishsinha/zeitgeist-dataproviders/add-ff-36-support-bug-775817/+merge/59704

You can review even though you are not in the ~zeitgeist-datasources-team

Artem (leipreachan) wrote :

Hi Manish
please see my comments in the branch.

tricote,

I fixed it. Hope it works now. Please try now

Artem (leipreachan) wrote :

It looks like the extension doesn't work when Firefox4 is standalone (in my case it's just copied into /opt/firefox4)
it shows "type error ..." message.
Have to investigate further.

Michael Trunner (trunneml) wrote :

If got the same problem under archlinux. I build the extension from bzr

Michael,

Where is your FF4 installed? Where is xulrunner2 installed?

Artem (leipreachan) wrote :

Manish, if xulrunner2 must be installed to run this extension?

yes, xulrunner 2.0 is a dependency

Changed in zeitgeist-dataproviders:
status: Fix Committed → In Progress
Artem (leipreachan) wrote :

okay, finally I was able to compile & install the extension with the standalone FF4 & xulrunner
That's what I did:
 - Download xulrunner 2.0 and xulrunner 2.0 sdk from http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/2.0/
 - install it into /opt/xulrunner/2.0 (runtime) and /opt/xulrunner/2.0-dev (sdk)
 - get trunk from bzr
 - ./autogen.sh LIBXUL_2_0_CFLAGS="-I/opt/xulrunner/2.0 -I/opt/xulrunner/2.0-dev/include/nspr -I/usr/include/nspr" LIBXUL_2_0_LIBS="-L/opt/xulrunner/2.0-dev/lib" XPIDL_BIN=/opt/xulrunner/2.0-dev/bin/xpidl XUL_IDLDIR=/opt/xulrunner/2.0-dev/idl
 - make
 - go to firefox-40-libzg and run make local-install, copy <email address hidden> folder into your profile's extension folder

done.
probably that will be helpful for somebody.

make local-install should copy <email address hidden> folder into your profile's extension folder

Artem (leipreachan) wrote :

err... yes, right. It copies itself into default profile. This step is unnecessary.
Anyway, "~/<email address hidden>" is not removed after make local-install:

make[1]: Leaving directory `/home/username/workspaces/build/zeitgeist-dataproviders/firefox-40-libzg/extension'
unzip -o ZeitgeistDataprovider.xpi -d ~/xpcom_firefox\@zeitgeist-project.com
Archive: ZeitgeistDataprovider.xpi
  inflating: /<email address hidden>/license.txt
...............................................
cd ~/.mozilla/firefox/*default*/ && mkdir -p extensions
cp -r ~/xpcom_firefox\@zeitgeist-project.com/ ~/.mozilla/firefox/*default*/extensions/

I hope it gets copied int he correct default profile. *default* gets replaced by the correct folder-name by some magic shell glob
functionality

Yes. ~/xpcom_firefox\@zeitgeist-project.com does not get deleted. Will add the solution in the script

Artem (leipreachan) wrote :

yes, the source profile is the default one.

thanks

So shall I mark this as fixed?

Artem (leipreachan) wrote :

yes, please.

Changed in zeitgeist-dataproviders:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.