Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

nsIAlertsService under Linux

10 views
Skip to first unread message

Lexxy

unread,
Oct 25, 2006, 2:21:11 AM10/25/06
to
Hello,

since Flock V0.7 Flock is one of the only firefox based browsers that
have the nsIAlertsService ready to go. With it, some extensions like
the Google Calendars Notifier are working under Linux.

Now, firefox2 has been released some days ago. But I don't see the
nsIAlertsService. Is it true that only Flock provides that service
under Linux? Why hasn't the service found it's way to firefox2?

Or am I missing something?

Best regards

Lexxy

Mike Connor

unread,
Oct 25, 2006, 10:21:10 PM10/25/06
to Lexxy, dev-apps...@lists.mozilla.org
its supposed to be enabled on Win32/Linux since very early this
year. See https://bugzilla.mozilla.org/show_bug.cgi?id=305375 and
https://bugzilla.mozilla.org/show_bug.cgi?id=310900

-- Mike

On 25-Oct-06, at 2:21 AM, Lexxy wrote:

> nsIAlertsService

Lexxy

unread,
Oct 27, 2006, 4:08:57 AM10/27/06
to
Hello, Mike

pleased to hear that.

Unfortunately I followed the instructions at developer.mozilla.org to
create a simple "test" of the alerts service but when started I got a
"Invalid InterfaceID" exception at this line:

var alertsService =
Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService);

That would possibly mean that:

a) the alerts service under linux uses a different InterfaceID
b) the interface ID is not available

I'll try flock now with exactly the same extension. If it works there,
I'll give up ;)

Best regards

Lexxy


Mike Connor schrieb:

Lexxy

unread,
Oct 27, 2006, 6:23:07 AM10/27/06
to
Hello,

some more information (which may be helpful): I use this one-liner in
the error console:

Components.classes['@mozilla.org/alerts-service;1'].getService(Components.interfaces.nsIAlertsService)

Firefox2 will show me this:

Fehler: uncaught exception: [Exception... "Invalid InterfaceID"
nsresult: "0x80570018 (NS_ERROR_XPC_BAD_IID)" location: "JS frame ::
javascript:
Components.classes['@mozilla.org/alerts-service;1'].getService(Components.interfaces.nsIAlertsService)
:: <TOP_LEVEL> :: line 1" data: no]

Funnily I activated the download alert in about:config, and I saw such
an alert ^^ so, yes, alerts are available under linux. However, it
seems that the interface might have changed for firefox 2.

Best regards

Lexxy

Lexxy

unread,
Oct 27, 2006, 9:48:36 AM10/27/06
to
Hello,

some more interesting facts: I installed XPCOM Viewer to check what
interfaces are provided by the alert service. There's something strange
(which may also come from the aged XPCOM viewer, of course!). Have a
look at this screenshot that shows Flock and Firefox 2:

http://s79.photobucket.com/albums/j157/lexxy23/Devel/?action=view&current=nsIAlertsServicesinFlockandFirefox2.png

This could explain why I can't access
Components.interfaces.nsIAlertsServices: it doesn't exist or is not
provided by the Components.classes object. Does anyone have an idea or
can provide a one-liner that shows how the alerts service is invoked
now? I know that it exists. But unfortunately it's not invokable as of

http://developer.mozilla.org/en/docs/nsIAlertsService

Adam Guthrie

unread,
Oct 28, 2006, 12:28:17 AM10/28/06
to
Lexxy wrote:
> This could explain why I can't access
> Components.interfaces.nsIAlertsServices: it doesn't exist or is not
> provided by the Components.classes object. Does anyone have an idea or
> can provide a one-liner that shows how the alerts service is invoked
> now? I know that it exists. But unfortunately it's not invokable as of

This seems to work fine for me in xpcshell:

js> var as =
Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService)
js> as
[xpconnect wrapped nsIAlertsService]

and I can confirm that I get the download complete alert when that pref.
is enabled, too. Does the error only happen when you try and get the
component in the JS console or does it happen in chrome, too?

-Adam

Lexxy

unread,
Oct 28, 2006, 1:25:51 PM10/28/06
to
Hello, Adam

trying the line in js console ends in this warning:

reference to undefined property Components.interfaces.nsIAlertsService


javascript:
Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService)

line: 1

and right after that the common exception about "Invalid InterfaceID"
;)

I can't test xpcshell because it's not installed here:

$> ./run-mozilla.sh ./xpcshell

run-mozilla.sh: Cannot execute ./xpcshell.

$> find | grep xpcshell
$>

In chrome (I think you mean the extension) I also get the exception but
not the warning (which may depend on some flags, I think).

Best regards

Lexxy

Lexxy

unread,
Nov 7, 2006, 3:40:01 AM11/7/06
to
Hello

it's been some time since my last post here so here are the steps to
reproduce my problem:

1. download the linux version of firefox (1.5 or 2.0, both should not
work)
2. install it
3. use a non-root account to execute this: ./firefox -P alertsProfile
(or use another profile, whatever you like)
3a. just tested: you can also use a root account. The problem also
occurs here.
4. open the javascript console (in Firefox 2: the error console)
5. execute this line:
Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService);

Expected result: nothing. You may get a single response that tells you
that the service is available, or something like that. No error or
warning should occur.

Actual result: BAD_IID exception. 0x80570018 (see my recent posts about
it)

I tested this with the following browsers:

a) Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20061031
Firefox/1.5.0.7 Flock/0.7.7 XpcomViewer/0.9
b) Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.6) Gecko/20060728
Firefox/1.5.0.6
c) Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1) Gecko/20061010
Firefox/2.0
d) Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1) Gecko/20061010
Firefox/2.0
e) Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.7) Gecko/20060909
Firefox/1.5.0.7

All those browsers are throwing an exception. And I don't expect an
extension or theme being capable of removing a components interface. Is
this worth re-opening the bug reports?

Regards

Lexxy

Mike Connor schrieb:

Adam Guthrie

unread,
Nov 11, 2006, 3:14:53 PM11/11/06
to
Lexxy wrote:
> All those browsers are throwing an exception. And I don't expect an
> extension or theme being capable of removing a components interface. Is
> this worth re-opening the bug reports?

I think the best thing to do at this point is to open a new bug with
steps to reproduce, which version of Firefox you're seeing this in, etc.
Please CC me (ispiked) if you file.

-Adam

0 new messages