How to access page content in chrome document with e10s?

So when using e10s, extensions can no longer directly access web page elements using things like getElementById. This is because the web pages are loaded in a content process, and not in the chrome document where the extension lives.

However, I have seen documentation saying that chrome:// URIs are still loaded in the chrome process. In that case, is there a way to access elements on chrome:// documents via getElementById directly from the extension?

I think that should still work. How are you trying to call it? And where is your page located(in what element)?

My extension includes an html file, and it will cause the browser to load it with a chrome:// URI. In that html page i have an object tag. So I am trying to access it with a getElementById.

So is Firefox smart enough to allow me to do “browser.contentDocument.getElementById()” like before when the page is loaded in the chrome process, and only complain when it knows the page is loaded in a different document?

Yes,
You can check this in the browser console.
When you load the chrome:// url your will have a contentDocument, but when you load the same file though a file:/// url it will be null.

Awesome! I will try. Thanks for your help.

Just a note, you should make it an xhtml file so you can support localization :smile:

https://github.com/Noitidart/l10n/tree/html-options

Or I think addon sdk has something for html files, not sure if you’re using sdk.