
Mozilla::ObserverService - Perl interface to the Mozilla nsIObserverService

use Mozilla::ObserverService;
my $cookie = Mozilla::PromptService::Register({
'http-on-examine-response' => sub {
my $http_channel = shift;
print $http_channel->responseStatus;
},
});
# We don't need it anymore...
Mozilla::PromptService::Unregister($cookie);

Mozilla::ObserverService uses Mozilla nsIObserverService to allow perl functions register for notifications.
For more detailed information see Mozilla's nsIObserverService documentation.

Registers callbacks (values of the $callbacks_hash) to the notifications specified by corresponding keys of the $callbacks_hash.
Note that all of those callbacks receive various mozilla's objects as parameters.
Returns opaque cookie which can be used to unregister callbacks later.
Uses cookie obtained by Register to unregister callbacks from observer service.

At present only nsIHttpChannel::responseStatus method is wrapped around in perl code (as shown in SYNOPSIS).

Mozilla nsIObserverService documentation, Gtk2::MozEmbed, Mozilla::DOM, Mozilla::Mechanize, Mozilla::PromptService.

Boris Sukholitko, <boriss@gmail.com>

Copyright (C) 2006 by Boris Sukholitko
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.