Disabling things in webbrowser?

themanfromthesea
themanfromthesea used Ask the Experts™
on
how do i disable image and javascript and such form being showed when navigating with the webbrowser? is it even possible?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I've taken this from one of my old answer:

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20374965.html#1

Hope it helps! And, yes it is possible!

http://msdn.microsoft.com/workshop/browser/hosting/wbcustomization.asp?frame=true#Controlling_Download_and_Execution

"The WebBrowser Control gives you control over what it downloads, displays, and executes. To gain this control, you need to implement your host's IDispatch so it handles DISPID_AMBIENT_DLCONTROL. When the WebBrowser Control is instantiated, it will call your IDispatch::Invoke with this ID. Set pvarResult to a combination of following flags, using the bitwise OR operator, to indicate your preferences."

DLCTL_NO_SCRIPTS and DLCTL_NO_JAVA: Scripts and Java applets will not be executed.

DLCTL_DLIMAGES, DLCTL_VIDEOS, and DLCTL_BGSOUNDS: Images, videos, and background sounds will be downloaded from the server and displayed or played if these flags are set. They will not be downloaded and displayed if the flags are not set.

And for the non-frame submit, well, if you recreate your form using a name this time, and you submit it using the newly given name, will it work?



Have a nice day!


Author

Commented:
It does looks interesting but I have absolutly no idear how to use it - it seems very diffecult.
I'll work something out for you but you'll have to wait until this evening. I have to go ;-).

See you later.

OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Author

Commented:
sounds nice thx :)
Sorry, I did not forgot you, I was totally busy during this last week and did not make my daily visit to EE ;-).

Try this: http://www.euromind.com/iedelphi/embeddedwb.htm

If you have problems, tell me, I'll look out the source code and make something out. I'll try however but as I'm still busy I won't make any promises :-).

Sorry again. Hope it solves your problem.
Use the DownloadOptions to set what you wanted.
EmbeddedWeb is a component that wraps the ActiveX component of WebBrowser plus the DISPID_AMBIENT_DLCONTROL (what I pointed out above) so it should do what you wanted.

Author

Commented:
The zipfile contains 3 pas-files but how do I import them?

Author

Commented:
The zipfile contains 3 pas-files but how do I import them?
In Delphi:

  Component | Install Component and browse for Unit File Name to one of the 3 files 'embeddedwb.pas' and click Ok!

Should work. Tell me if you still have problems with that.

Author

Commented:
I can not install a component without a component. I only have to 3 pasfiles. (need a dkp file)

Author

Commented:
I can not install a component without a component. I only have to 3 pasfiles. (need a dkp file)
No, you don't need a dpk to install a component. Components are .pas in reality. DPK are components package. You can add a component (.pas) into a already existent package such as Delphi Component User (.dpk) such as described above.

:-)

You use the 'embeddedwb.pas' which is the components. The other 2 '.pas' are needed for the component.

Hope it helps.
So, need more help with this?
themanfromthesea:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial