Soruma göre oldukça basit, bir NaCl modülü çağıran bir krom uzantısı oluşturmaya çalıştım. Düğmem ve farklı dosyalarm iyi görünüyor ve C++'daki oldukça basit kodum bir PostMessage hello World'ü döndürüyor. Ama, denediğimde işe yaramıyor. Bir Chrome uzantısında bir NaCl modülü dahil etmediğim belirli şeyler var mı? Umarım biraz umut kaybediyorum.Bir Chrome Uzantısında NaCl Ekleme
İşte benim "background.html" dir: Burada
<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>
benim "background.js": at last
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);
Ve benim "manifest.json":
{
"name": "Correction de Cordial sous Chrome",
"version": "1.0",
"background_page" :"background.html",
"description": "Intégration d'une extension Cordial pour la correction sous Chrome",
"permissions": [
"tabs", "http://*/*"
],
"browser_action": {
"default_icon": "corriger_big.png", // Icône de l'extension
"default_title": "Correction de Cordial" // Titre affiche sur le bouton
}
}
Herhangi bir fikri olan varsa, minnettar olurum.