Walking the DOM with a Delphi app called from a Firefox extension

Posted on 2004-10-04
Last Modified: 2013-11-19
Yeah, well, some Delphi guru may be working with Mozilla and Firefox.

Firefox extensions more or less, it seems to me, rely on js. Is there some way we can write a delphi app or com object, callable from js,  that can pick up a pointer to the document in the Firefox browser and then walk the DOM from there?
Question by:Mutley2003
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12215801
I think the security mechanism would get in your way. It depends on the concept from where your app calls the DOM of Mozilla but I don't think you would get easy access to it.

Author Comment

ID: 12257023
hmm, not good news. If you are programming IE extensions the "security mechanism" does not "get in your way".
LVL 26

Expert Comment

ID: 12468468
Why not walk the DOM in the javascript?
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI


Author Comment

ID: 12470561
Hi Eddie
Yes I could do that I guess. But what if I wanted to do something that could best be done in Delphi, like, for example

a) displaying a nice treeview of the DOM or the images using Mike Lischke's Virtual Treeview

b) dynamically modifying the DHTML based on an analysis of the keywords

I'd rather write "analysis" type applications in Delphi than in js

So, any ideas ?
LVL 26

Expert Comment

ID: 12472700
I have written a couple of Firefox extensions but they were merely modifications
of existing ones. I haven't looked too deeply into the task but I'll see what I can find out.
LVL 26

Accepted Solution

EddieShipman earned 500 total points
ID: 12472711
I do know that getting to the DOM from outside of Firefox is a very, should I say, hidden thing. I can get no one to
answer my questions on how to get the IHTMLDocument2 from a running instance of Firefox.

Author Comment

ID: 12480566
Is there some way one can pass through external.menuArguments.document to a COM object via js..
LVL 26

Expert Comment

ID: 12483286
I have NO IDEA!

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question