简体   繁体   中英

how to start the javascript function in my firebreath plugin

I have implemented a javascript function in firebreath plugin file 'MyPluginProject.cpp'

like

void MyPluginProjectAPI::MyJsThings()
{
    std::string argument = "my javascript functionality goes here";

    m_host->evaluateJavaScript(argument);
}

Now to use the MyJsThings in my webpages I have created <object> for the plugin. Now I can call MyJsThings by calling it in my javascript code like below

plugin.MyJsThings()

This is the very basic thing. Now I don't want to call MyJsThings method in my javascript. I am just creating object for the plugin by below code.

<object type="application/x-my-plugin-project" id="plugin" style="width:0px;height:0px;">
        <param id="onload" value="alert('Plugin Loaded');"> 
</object>

When I load my page I want my method MyJsFunction has to be called so that my js functionalities will do the remaining things.
My main aim is to call the function MyJsFunction when the plugin is loaded, not in any where in the html script.

Sounds like what you really want is to use the onPluginLoad method in your PluginCore-derived object.

Note that you would have found this if you'd read the getting started pages on the website and/or looked through the FBTestPlugin example -- highly recommended reading.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM