My question is quite simple, I tried to create a chrome extension that calls a NaCl module. My button and different files seem to be ok, and my quite simple code in C++ returns a PostMessage hello World. But, when I try it, it doesn't work. Are there specific things that I haven't done for including a NaCl module in a Chrome extension? I must say that I'm a little bit losing hope.
Here is my "background.html":
<body> <script src="background.js"></script> <div id="listener"> <embed name="nacl_module" id="nacl_correction" src="nacl_correction.nmf" type="application/x-nacl" /> </div> <script > document.getElementById('listener').addEventListener('load', moduleDidLoad, true); </script> </body>
Here is my "background.js" :
var NaclCorrectionModule = null; // Global application object. function moduleDidLoad() { NaclCorrectionModule = document.getElementById('nacl_correction'); //alert( NaclCorrectionModule); if (NaclCorrectionModule == null) { alert('Out'); } else { alert (NaclCorrectionModule); } NaclCorrectionModule.addEventListener('message', handleMessage, false); } function handleMessage(message_event) { alert(message_event.data); } chrome.browserAction.onClicked.addListener(moduleDidLoad);
And, at last, my "Manifest.json" :
If anybody has any ideas, I would be thankful.