Accessing the FF DOM from an external process (C++)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Accessing the FF DOM from an external process (C++)

SeanE
Hi there,
Im trying to access the firefox DOM from an external application. I believe this is supposed to be possible using the ISimpleDOMNode and ISimpleDOMDocument interfaces.

Currently I have the following code:
       
IAccessible* pAcc=NULL;
ISimpleDOMNode* pNode = NULL;
ISimpleDOMDocument* pDoc = NULL;

HRESULT hr;

HWND hFF = ::FindWindowExA(0, 0, "MozillaUIWindowClass", 0);

// drill down to the Document level
if (hFF)
{
HWND hTemp;
hTemp = ::FindWindowExA(hFF, 0, "MozillaWindowClass", 0);
hTemp = ::FindWindowExA(hTemp, 0, "MozillaWindowClass", 0);

HWND hChild = ::GetWindow(hTemp, GW_CHILD);

while (hTemp && !hChild)
{
hTemp = ::GetWindow(hTemp, GW_HWNDNEXT);
hChild = ::GetWindow(hTemp, GW_CHILD);
}

if (hTemp)
{
hTemp = ::GetWindow(hTemp, GW_CHILD);
hContent = ::FindWindowExA(hTemp, 0, "MozillaContentWindowClass", 0);
}
}
       
AccessibleObjectFromWindow(hContent,OBJID_WINDOW,IID_IAccessible,(void**)&pAcc);
hr = pAcc->QueryInterface(IID_ISimpleDOMDocument, (void**)&pDoc);

=======
       

Im getting a valid pAcc pointer and the HWND im sending in is the 'Document', however my problem lies in the fact that I am not getting a valid pDoc pointer. The HRESULT returns as E_NOINTERFACE. The same error occurs if i try to get an ISimpleDOMNode.

I have tried this on FF2, FF3.0.5 and FF3.2 to no avail. Is what im trying to do even possible? The project currently contains the .IDL files and the _i.c files.

Thanks in advance,
Sean