我正在使用 firebreath 框架编写浏览器插件。当我将插件与 javascript 一起使用时,我收到一个奇怪的错误:
unsupported: no toString() function in type function
当我尝试在我的 Dropbox_pluginAPI 类上多次调用返回 JSAPIPtr 的方法时,我收到此错误。
这是代码:
//JavaScript context
for(var i=0; i<100; i++)
{
//After several times of calling the method I get the error: unsupported: no toString() function in type function
var md = plugin().getMetaDataOfFileOrFolder("dropbox/demotext","null",true,false,"null");
}
//API class
FB::JSAPIPtr Dropbox_pluginAPI::getMetaDataOfFileOrFolder(std::string fileOrFolderPath,std::string hash, bool list, bool include_deleted,
std::string rev)
{
MetaData m = client->getMetaDataOfFileOrFolder(fileOrFolderPath,hash,list,include_deleted,rev);
return boost::make_shared<MetaDataAPI>(m_host,m);
}
//MetaDataAPI class
class MetaDataAPI : public FB::JSAPIAuto
{
public:
/**
* Constructor.
* @param host The browser
* @param m The MetaData object
*/
MetaDataAPI(const FB::BrowserHostPtr& host,MetaData m);
.....
.....
}
我希望有人使用firebreath并可以帮助我!
我更新了firefox版本并将片段分成不同的行,但错误仍然存在。我做了以下事情:
var plug = plugin();
var fn = plug.getMetaDataOfFileOrFolder;
var md;
for(var i=0; i<100; i++)
{
md = fn("dropbox/demotext","null",true,false,"null");
}
alert("Finish");
永远不会调用警报!一些电话后仍然存在错误:
[unsupported: no toString() function in type function]
排队:
md = fn("dropbox/demotext","null",true,false,"null");