Note that there are some explanatory texts on larger screens.

plurals
  1. POBrowser agnostic C++ DOM interface
    primarykey
    data
    text
    <p>When programming in C++ against the browser's <a href="http://www.google.co.il/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.w3.org%2FDOM%2F&amp;ei=eUhrSaTCDpyY9QSMr5imBw&amp;usg=AFQjCNH0daWhsLwlt2sAqQJ71Vx8WtrHug&amp;sig2=9eYS8DOTG8VOj3tJSKjyvg" rel="nofollow noreferrer">DOM</a> each engine has a different set of interfaces, IE has the COM based [MSHTML](<a href="http://msdn.microsoft.com/en-us/library/aa752279(VS.85).aspx)" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa752279(VS.85).aspx)</a>, Mozilla has the <a href="http://en.wikipedia.org/wiki/XPCOM" rel="nofollow noreferrer">XPCOM</a> based <a href="http://www.xulplanet.com/references/xpcomref/ifaces/nsIDOMNSHTMLElement.html" rel="nofollow noreferrer">Gecko DOM</a> etc. </p> <p>Is there a common API that has <a href="http://en.wikipedia.org/wiki/Adapter_pattern" rel="nofollow noreferrer" title="Adapter Pattern">adapters</a> for major browsers (and versions)?</p> <hr> <p>As a clarification, the application in question is a desktop application written in C++ which interacts with browsers, currently we have separate code bases for support of IE and Mozilla and I'm trying to reduce duplications of logic and allow adding new browsers with less effort. </p> <p>A concrete example can be getting the innerHTML property of an HTML element.</p> <pre><code>// Firefox nsAutoString html; nsCOMPtr&lt;nsIDOMNSHTMLElement&gt; elem = do_QueryInterface(obj); if (elem) elem-&gt;GetInnerHTML(html); // IE CComBSTR html; MSHTML::IHTMLElementPtr elem = obj; if (elem) elem-&gt;get_innerHTML(&amp;html); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload