![]() |
How to disable scripts when using CXTHtmlView |
Post Reply ![]() |
Author | |
fabien7474 ![]() Newbie ![]() Joined: 09 December 2006 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 09 December 2006 at 5:14am |
Hi,
I am using the CXTHtmlView class in our MFC document/view application in order to display HTML pages in a WebBrowser style. Nevertheless, we would like sometimes to disable scripts (for instance java-scripts) when rendering the HTML page (for security reasons). I didn''t find any method/code that provides this functionnality.
Do you know if it is possible to do it using CXTHtmlView class. If not, what do you suggest in order to do it.
Thank you very very much, Fabien. |
|
![]() |
|
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
I would like to be able to disable Flash on various sites, would also like any pointers.
|
|
Simon HB9DRV
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Check in msdn:
DISPID_AMBIENT_DLCONTROL and DLCTL_NO_SCRIPTS.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
fabien7474 ![]() Newbie ![]() Joined: 09 December 2006 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg.
Thank you very much!! Anyway, I have been searching for DISPID_AMBIENT_DLCONTROL and DLCTL_NO_SCRIPTS but I didn't find any relevant C++ code, using these properties. Do you know how to use it? Do I need to use PutProperty() from CHtmlView? Do you have a very simple sample code? Thank you soooo much for your help... Fabien |
|
![]() |
|
fabien7474 ![]() Newbie ![]() Joined: 09 December 2006 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Okay Guys!!
I spent my day on it but I finally figure out how to do it: BOOL CMyHtmlView::OnAmbientProperty(COleControlSite* pSite, DISPID dispid, VARIANT* pvar) { if (dispid == DISPID_AMBIENT_DLCONTROL) { pvar->vt = VT_I4; pvar->lVal = DLCTL_NO_SCRIPTS | DLCTL_NO_JAVA | DLCTL_NO_RUNACTIVEXCTLS | DLCTL_NO_DLACTIVEXCTLS; return true; } return HtmlView::OnAmbientProperty } Thanks, Fabien. |
|
![]() |
|
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
Excellent - weel done lad! |
|
Simon HB9DRV
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |