Select and copy the contents of firefox to the clipboard in C or C ++

I found several questions similar to mine, but none of the answers are satisfactory, and they are several years old. Therefore, I hope that since then, perhaps, some progress has been made on this front.

I'm interested in the ability to access the contents of an active Firefox window and copy it to the clipboard - using C or C ++ code.

In Internet Explorer, I can use COM IHTMLDocument2 to access the contents of the broswer DOM .

Is there something similar in Firefox? If so, how to do it?

By the way, my current (ugly) workaround is to simulate Ctrl + A, Ctrl + C by sending virtual keystrokes, but this is not a very reliable and elegant solution.

Ideas, advice, understanding, knowledge are welcome.

Thank.

Note. To clarify the issue even further, I would like to point out that I am not interested in Javascript or Flash . Instead, I am interested in the C / C ++ solution, even if it is limited only to the Microsoft Windows platform.

+3
source share
1 answer

The DOM in firefox is exposed to C ++ through XPCOM , but be careful, unlike MSHTML (in IE), Mozilla's interfaces are not always frozen, non-frozen interfaces are version-specific and may change from release to release.

XPCOM equivalent IHTMLDocument2 nsIDOMDocument.

XPCOM COM, nsISupports ​​ , IUnknown ( GUID), , COM XPCOM (, XPCOM IDispatch).

+3

Source: https://habr.com/ru/post/1768369/


All Articles