First goes some background about what I am doing with Firebreath.
- I am developing a rendering viewer plugin in browser by using firebreath.
- I define two MIME type in my plugin, one is for the main viewer, and the other is for 2D plan view.
- In each page, only one main viewer is allowed, but can have multiple 2D plan view. And they all share the same model document opened in main viewer.
- So, after instantiating 2D plan view, I need to pass the document object (a firebreath JSAPI) to the 2d plan view.
Then, assume the main viewer and plan view are both loaded named as 'mainviewer' and 'planview', and I will attch the document to plan viewer as below,
planview.attach(mainviewer.doc);
(the signature is "bool attach(const FB::JSObjectPtr& myDoc)" and
The mainviewer.doc is just a firebreath JSAPI)
The ISSUE is that in firefox, the passed JSObject can't be recognized as a JSAPI by calling
FB::JSAPIPtr jsAPI = myDoc->getJSAPI(); // THIS WILL RETURN **NULL**.
m_main_doc = FB::ptr_cast<LcFbViewerDocumentAPI>(jsAPI); // Cast to my document API.
This issue only happens when the host browser is firefox, IE/Chrome works well.
So, what happened to the passed JSAPI when using firefox?