Chrome cannot find method HelloWorld

136 views
Skip to first unread message

ZelluX

unread,
Dec 24, 2009, 8:50:15 AM12/24/09
to nixysa-users
Hi, all

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.

Emit Sorrels

unread,
Jan 14, 2010, 3:50:57 PM1/14/10
to nixysa-users
I'm encountering the same exact issue, using the latest svn chromium,
git nixysa on arch linux.

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?

Makiss

unread,
Mar 6, 2010, 1:21:35 PM3/6/10
to nixysa-users
me too, and there is the same problem when I used firebreath.
Reply all
Reply to author
Forward
0 new messages