I'm trying to build my first plugin with nixysa in Ubuntu, but failed
to get plugin.HelloWorld() in tutorial, this is what I did:
First compiling of the HelloWorld example, is all OK, and I add two
files in the plugin directory
manifest.json:
{
"name": "Hello World",
"version": "0.1",
"description": "Hello World.",
"background_page": "background.html",
"browser_action": {
"default_icon": "64.png",
"default_title": "Hello World"
},
"content_scripts": [
{
"matches": ["file:///*"],
"js": ["jquery-1.3.2.min.js", "input.js"]
}
],
"plugins": [
{ "path": "libhelloworld.so", "public": true }
]
}
background.html:
<embed type="application/HelloWorld" id="pluginId">
<script>
var plugin = document.getElementById("pluginId");
alert(plugin);
for (var member in plugin) { console.log(member); };
var result = plugin.HelloWorld(); // call a method in
your plugin
if (!result)
alert("no plugin");
alert(hw.getHw());
</script>
After that I run chrome --load-extension='plugin dir' to load the
compiled libhelloworld.so, and I can see the .so file loaded
successfully in the about:plugins page.
But in the extension developer page(chrome-extension://ahiiexxxxx/
background.html), it reports an error:
Uncaught TypeError: Object #<an HTMLEmbedElement> has no method
'HelloWorld'
What's wrong here? Many thanks for your replies.
I compiled the hello world tutorial, dropped the .so in /usr/lib/
mozilla/plugins
and loaded the same html file in both firefox 3.5.6 and chromium.
Works as expected in firefox, but I am also getting the
Uncaught TypeError: Object #<an HTMLObjectElement> has no method
'HelloWorld'
error when I check it though the built in chromium javascript console.
both firefox and chromium are showing the HelloWorld plugin loaded
(about:plugins)...
any ideas?