How to access a document's HTML in Firefox using IAccessible

后端 未结 1 2025
情书的邮戳
情书的邮戳 2021-01-06 07:57

I can get an IAccessible object from a Firefox window using this code:

Guid guid = new Guid(\"{618736E0-3C3D-11CF-810C-00AA00389B71}\");
object obj = null;
i         


        
相关标签:
1条回答
  • 2021-01-06 08:35

    Apparently you can't get the full HTML source using IAccessible. I found this but it doesn't work in FF3.5:

    IServiceProvider *pServProv = NULL;
    pAccessible->QueryInterface(IID_IServiceProvider, (void**)&pServProv);
    ISimpleDOMNode *pSimpleDOMNode;
    if (pServProv) {
      const GUID refguid = {0x0c539790, 0x12e4, 0x11cf, 0xb6, 0x61,
                            0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8};
      HRESULT result = pServProv->QueryService(refguid, IID_ISimpleDOMNode,
                                               (void**)&pSimpleDOMNode);
      if (SUCCEEDED(hresult) && pSimpleDOMNode != NULL) {
        /* This is a Mozilla node! Use special ISimpleDOMNode methods described in
          ISimpleDOMNode.idl. */
      }
    }
    

    I also found this, which doesn't work in FF3.5 either:

    HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_CLIENT,
          IID_IAccessible, (void**)&pAccessible);
    if (SUCCEEDED(hr) && pAccessible != NULL) {
    HRESULT hr = pAccessible->QueryInterface(
          IID_ISimpleDOMNode, (void**)&pSimpleDOMNode);
    }
    

    I'm stuck. :(

    0 讨论(0)
提交回复
热议问题