When programming in C++ against the browser's DOM each engine has a different set of interfaces, IE has the COM based MSHTML, Mozilla has the XPCOM based Gecko DOM etc.
Is there a common API that has adapters for major browsers (and versions)?
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.
A concrete example can be getting the innerHTML property of an HTML element.
// Firefox
nsAutoString html;
nsCOMPtr<nsIDOMNSHTMLElement> elem = do_QueryInterface(obj);
if (elem)
elem->GetInnerHTML(html);
// IE
CComBSTR html;
MSHTML::IHTMLElementPtr elem = obj;
if (elem)
elem->get_innerHTML(&html);