hi , i have created a npapi plugin which works fine if loaded from page directly. But now if i inject it from content script and call a method i get error that method not found Uncaught TypeError: Object # has no method 'Add' chrome version--14.0.835.202 m ///////////// manifest.json ///////// { "name": "npapi", "version": "1.0", "description": "The first extension that I made.", "background_page": "bk.html", "browser_action": { "default_icon": "icon.png" }, "plugins": [ { "path": "npcodeproject.dll","public": true} ], "permissions": [ "tabs", "http://*/*", "https://*/*" ], "content_scripts": [ { "matches": [""], "js": ["myscript.js"], "run_at" : "document_start" } ] } ----------------------------- ////////////// myscript.js ////////////// function initplugin() { alert("initplugin"); var myEmbed = document.createElement('embed'); myEmbed.setAttribute("type", "application/npcodeproject"); myEmbed.setAttribute("id", "opplugin"); document.head.appendChild (myEmbed); var opplugin = document.getElementById("opplugin"); if(opplugin==null) alert("opplugin fail"); else alert("opplugin succ"); opplugin.Add("2","2"); } //initplugin(); document.onreadystatechange = function () { if (document.readyState == "complete") { initplugin(); } } ///////////////// please let me know what is problem and solution


LinkBack URL
About LinkBacks



Reply With Quote