Load an iframe into a page (using page-mod) from the extension data

Relative to:
https://bugzilla.mozilla.org/show_bug.cgi?id=792479

Basically, I have a page-mod which should append an iframe element to the on going Web page. That iframe should load a Web application from the extension’s data folder. Then, that application might communicate with the page-mod (or the add-ons scripts) through the standard postMessage API.

It’s pretty much what I’ve done with a Chromium implementation of that extension.

Unfortunately, doing so with Firefox doesn’t work as expected:

Security Error: Content at http://mozilla.org may not load or link to resource://<extension-id>/data/main.html.

Some work-arounds have been given on bugzilla, but it’s been a little while and I’m wondering if any one had find out a proper way to do so?

You cant load privelaged stuff into unprivelaged. Only way I know how is to do it with a non-sdk addon. In the chrome.manifest add contentaccessible=true to the folder then you can do it. This is how i did it pre-e10s it still works: https://gist.github.com/Noitidart/9406437

Just to mention that I’ve chosen to host the content of that iframe on a distant server (and using the postMessage standard API to communicate with the contentScript).