I have a website and a Google Chrome extension. The extension uses the NaCl API (JavaScript) to write/read files (C++) from user's computer.
My question is: Can I load my extension in my website, for example, in an iFrame and keep its functions?
I tried to do it, but it only loads the extension "visual" part. The write/read (NaCl) functions didn't work.
An example to better explain what I wanna do:
It's actually working this way:
I'd like to do this:
Or this another way, but I think it's not possible, is it?
Is it possible? How can I do it?
EDIT
Here is the code:
In manifest.json I put this:
"externally_connectable": {
"matches": ["http://www.example.com/index.html"]
},
"web_accessible_resources": [
"/*"
],
"content_scripts" : [
{
"matches" : ["http://www.example.com/index.html"],
"js": ["index.js"]
}
],
My website's Iframe:
<iframe src="chrome-extension://myextensionid/index.html"></iframe>
In my extension index.js file, just has two buttons. Their functions (JavaScript) communicate with the .cc file (through NaCl) to save or load a string in a file on computer.
As I said, the extension is working fine, but when I try to load it in my website through an Iframe, it only loads the html (visual). The JavaScript doesn't load, consequently, the C++ neither, as long as the JS calls the C++ functions with NaCl.
Any solution?