hust-marx / firebreath

Automatically exported from code.google.com/p/firebreath
0 stars 0 forks source link

echo method do not work #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Iam just build my plugin without any changes to code after it generation.
But when iam call native method 'echo' to test it , firebug say me that the
plugin.echo is not a function . Iam just newbie about writing and working
with plugins maybe someone can help me , please ?

Here's how i call a plugin from JavaScript:

<script>
var mimetype = navigator.mimeTypes["application/my-plugin"];

    if (mimetype) {
       // Yes, so can we display with a plug-in?
       var plugin = mimetype.enabledPlugin;
       if (plugin) {
          // Yes, so show the data in-line
          alert(plugin.version);
          alert(plugin.valid);
          var result = plugin.echo("TEST");
          document.writeln("Plugin start " +result);

       } else {
          // No, so provide a link to the data
          document.writeln("plugin not enable");
       }
    } else {
       // No, so tell them so
       document.writeln("plugin do not work");
    }
</script>

Original issue reported on code.google.com by Podmoo...@gmail.com on 28 Feb 2010 at 11:16

GoogleCodeExporter commented 9 years ago
Need a few more details; what plugin are you using?  what is the code for 
"echo"? 
how are you registering it?

You may want to post this question on the firebreath-dev list instead of here 
as an
issue, because this is likely something you're not doing right instead of a bug 
with
FireBreath.  Either way, we need more details.

Original comment by taxilian on 28 Feb 2010 at 3:43

GoogleCodeExporter commented 9 years ago
Thank you for answer , problem was in the way how i call it from js. Maybe it 
would
be useful for other , the right way to do that:
<object id="plugin" type="application/my-plugin" ></object>
<a href="javascript:alert(plugin.version)">alert plugin valid</a> <br />

Original comment by Podmoo...@gmail.com on 1 Mar 2010 at 10:13

GoogleCodeExporter commented 9 years ago
Yep, "enabledPlugin" only tells you if a plugin for Mime-type is available. You 
can't
instantiate them dynamically from there, only via object or embed tags in your 
pages.

Original comment by georg.fritzsche on 1 Mar 2010 at 10:40