Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 2 of 2

This is a discussion on embed and load npapi plugin from content script within the Chrome Plugins section, part of the Google Chrome category: hi , i have created a npapi plugin which works fine if loaded from page directly. But now if i ...


  1. #1
    rajeshmk2011 is offline Junior Member
    Join Date
    Oct 2011
    Posts
    2

    Default embed and load npapi plugin from content script

    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
    Last edited by rajeshmk2011; 10-11-2011 at 01:11 PM. Reason: format

  2. #2
    rajeshmk2011 is offline Junior Member
    Join Date
    Oct 2011
    Posts
    2

    Default

    admin please reply

Similar Threads

  1. How to debug content script?
    By alex82 in forum Plugins Development
    Replies: 6
    Last Post: 07-21-2012, 03:45 PM
  2. Replies: 1
    Last Post: 06-19-2011, 07:42 PM
  3. content script help
    By crackruckles in forum Plugins Development
    Replies: 7
    Last Post: 02-19-2010, 04:31 AM
  4. Content Script Issues
    By hexid in forum Plugins Development
    Replies: 2
    Last Post: 12-15-2009, 03:37 PM
  5. content script problem..
    By Gaurang033 in forum Chrome Plugins
    Replies: 0
    Last Post: 06-01-2009, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •