Solved

Separate the navigation by downloading in embedded WebBrowser

Posted on 2006-06-23
1
193 Views
Last Modified: 2010-04-05
in EmbeddedWBBeforeNavigate2 event I have an own code that I wish to run just when I start to load a new page. The problem is that when I click a link and start to download a file the code run too.  

How can I separate these? I wish to run my code just for navigation and ignore it for downloading files.
0
Comment
Question by:ginsonic
1 Comment
 
LVL 28

Accepted Solution

by:
2266180 earned 100 total points
ID: 16974605
I needed to do something similar, with the difference that I was loading the pages from disk and the links that the user clicked on were to be opened in the default browser.

the way I fixed it was to have a global boolean value, inner = false, and checking against it in the event.

in your case it's simpler.
before you load the page (you issue a navigate command yourself, from code), you set inner=true.
then in the event, if inner=true then execute the code AND set inner to false;

this way, the code executes only when you load the pages.

now, if you want to allow the user to open pages by clicking on links, things go harder. you will have to also check against the url and make sure it's not a file (the protocol is not ftp:// and not file:// and mayeb some other stuff). you can also use the headers and see the mime type. as I said, it gets trickier
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 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