You have to send messages to the parent page-mod, using the
postMessage method and onMessage listener.
Hernán
But I want chrome privs to elevated access the DOM of the page in which
the page-mod exists - the point of using a page-mod is to get access to
the DOM.
Joe.
Well, you can send messages from the content-script of the page-mod
(that has access to the DOM, thus you can add handlers there) to the
parent page-mod object (that has chrome privileges). The page-mod does
what you need, and sends back a message to its content script -in case
you need a callback- saying that its done or returning a result. Keep
in mind that you can only send JSON messages through the
content-script and the page-mod.
The reason scripts with DOM access don't have chrome privileges other
than security reasons is that in the near future the Jetpack code will
run in a different process than content (this is what the Electrolisys
project has been doing, a.k.a. E10s). Thus the SDK has to be
E10s-compatible and chrome privileges where stripped from
content-scripts.
Hernán
The parent of the page-mod object is the addon, which does have chrome
privs, but which does not have access to the DOM. I need both to be able
to look at the contents of cross domain stylesheets.
Thanks,
Joe.