|
Hi,
The xpconnect provides a way to call xpcom
component from javascript. It's useful to implement some kind of
"back-channel" notification. I implemented an testing example to notify my
embedding brwoser app from the javascript in a page. It's kind of working but it
has security issues, such as popping up a privilege confirmation dialog and
having to sign the script if it's from network. It's, at least, not
convenient for our application. We don't use keyboard or mouse, so confirming
the privilege dialog or so is unexpected. What I like to have:
1. a back-channel notification from javascript
to the customised browser app which implements some kind of the
callback (notification) service interface.
2. no privilege popup dialog occurs. -- this
may be done by pref conf.
3. the javascript only has certain permittable
scripting into the customised xpcom callback service without
requiring signing the scripts rather than access
a range of xpcom services with
signing.
Is any good way to achieve that? One idea emerging
on my mind is to use something like "a plugin" as a "firewall" in
between untrusted scripts and the customised brwoser application internal.
Because such special plugin is usually released with the thrid-party
customised browser application, the plugin is usually trusted. The untrusted
scripts call back the customized brwoser internal through the plugin's
filtering. In this way, signing scripts and confirming security prompt may
be avoided and yet keeping the similar level of security as before. To do so,
the calling framework may need to be extended. It's just a popup
thought. I appreciate if anyone gives
different suggestions, appraoches and solutions.
Thanks
|
