The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Capturing current browser text

Hello All,

I have an application which needs to capture current text from active browser, and I would like to support both IE & Firefox.

I did a Google Search and found DDE as one way to communicate with IE. For Firefox, I guess I will have to write an extention to firefox.

Any other pointers to solve this problem?

Martin R
Sunday, August 27, 2006
Can you use a Copy/Paste based workflow?
System of a Don Send private email
Sunday, August 27, 2006
Maybe this is overkill, but you could build a very simple local proxy app that the browser goes through.  That way you'd see everything sent and received.  Then you just need to redirect the browser to go through your proxy.  I've done it with IE programatically (with the user's consent)--not sure about FireFox.
Doug Send private email
Sunday, August 27, 2006
Printer Friendly ( is an IE and FF extension that does this.

The IE code is built as a Browser Helper Object (BHO), using specific Windows registry hooks available for IE integration through C++/ATL. Look up BHO's on MSDN for more information.

The FF extension uses Javascript with XUL to access the DOM of the document before sending it through XPCOM to the C++ dll which does the logic and returns it back to the javascript layer for further processing. Look for XPCOM at the Mozilla site for more information on this.
Andrey Butov Send private email
Monday, August 28, 2006
Look for "Subclassing" .. you enumerate and subclass the window handles, and read the properties... in the case of IE you should be able to attach to the Idocument.

Monday, August 28, 2006
If you try to enumerate an HTML document's child windows, you will quickly find that not all elements are windows!

When you ask about the "current text", are you referring to user-highlighted text, or to the current document as a whole?
Chris Marshall (SuperBot Offline Browser) Send private email
Monday, August 28, 2006
Thanks for the responses. Chris, I was refering to the document as a whole..
Martin R
Monday, August 28, 2006
Keep in mind that the HTML source for a web page is not always the same as what is displayed.

You may need to traverse the DOM result of a webpage that has embedded, dynamic content generation code (javascript) to grab what is actually displayed on screen.

Aaron DC Send private email
Tuesday, August 29, 2006
ya. and then you have IFrames...a lovely time ahead man :)
Tuesday, August 29, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz