views:

610

answers:

3

Hi guys!

I have a question:

My program will search FireFox windows opened by user. When a user open Firefox and enter any site, I want to search for a keyword in that page's HTML content.

How can I access Firefox's Active Tab's DOM (or HTML content) from outside firefox using my C++ program.

Is it possible? If so, can you give me some idea or links?

If it is not possible, how can I copy text to clipboard within Firebox without installing / setting up anything?

Best regards, Nuri Akman

+1  A: 

It can be done through addons

Umair Ahmed
A: 

To copy htm contents of a page in Firefox, use the View > Page Source menu and then copy the contents of the resulting window to the clipboard (Control-A to select all, Control-C to copy).

What is it that you're trying to do?

jdigital
+1  A: 

There is no built-in way to access the DOM of a web page inside Firefox from an external program. You can write an extension that implements some sort of IPC (using sockets or whatever) and communicate with that, but not built-in to Firefox.

Ted Mielczarek
Flash does it. How does it do it?
Android Eve
@Android, Flash is a plugin in firefox (which is similar to extensions)
Motti
@Motti, sorry but I have never programmed for Firefox, so I don't understand the distinction between a plugin/extension and ??? Could you please explain? Thanks.
Android Eve
@Android, an Extension extends the Firefox's functionality (Ad block, anti virus) a Plugin handles media types the Firefox doesn't know (Flash, Silverlight, video) they are both types of Addons and interact with the DOM the same way (via JavaScript, NPAPI or XPCOM)
Motti
@Motti, thank you very much. Your ability to articulate your knowledge is impressive. Another +1 for that.
Android Eve