我需要一些幫助來阻止Internet Explorer或.NET Webbrowser控件中的iframe。我嘗試過安全性偏好,但這種方式無效。 XP和IE8,使用.NET框架4.0如何在Internet Explorer或.NET瀏覽器控件中阻止iframe
1
A
回答
6
在DocumentCompleted
事件您WebBrowser
,只需刪除所有元素:
foreach(HtmlElement x in ((WebBrowser) sender).Document.GetElementsByTagName("iframe")) {
x.OuterHtml = String.Empty;
}
相關問題
- 1. 使用Internet Explorer瀏覽器
- 2. 多個Internet Explorer瀏覽器
- 3. 瀏覽器阻止?
- 4. 如何在Web瀏覽器控件中阻止onbeforeload JavaScript?
- 5. 如何在Web瀏覽器控件中阻止Flash元素
- 6. 在Internet Explorer中的瀏覽器模式
- 7. 在FF和Internet Explorer中,Chrome瀏覽器中的Chrome瀏覽器
- 8. Internet Explorer到谷歌瀏覽器在wapache
- 9. 在Internet Explorer 10中是否支持瀏覽器插件(如Silverlight)?
- 10. 如何在Android上阻止瀏覽器?
- 11. Internet Explorer何時/爲何阻止(簽名)ActiveX控件的安裝?
- 12. 如何阻止用戶在瀏覽器中瀏覽?
- 13. Internet Explorer阻止重定向?
- 14. 阻止Internet Explorer用戶
- 15. WPF Web瀏覽器控件繼承Internet Explorer縮放級別
- 16. 如何在mchanize中使用Internet Explorer作爲瀏覽器
- 17. 如何在Internet Explorer選項卡中打開SWT瀏覽器?
- 18. 如何在Internet Explorer中禁用Java過時的ActiveX控件阻止功能
- 19. 多個Internet Explorer版本瀏覽器測試(Internet Explorer 6-8)?
- 20. Internet Explorer阻止下載文件
- 21. 使用硒,如何檢測Internet Explorer瀏覽器插件?
- 22. 使用Internet Explorer瀏覽器的Selenium ide
- 23. Internet Explorer瀏覽器問題引導
- 24. 瀏覽器Internet Explorer專用的css
- 25. 如何確保嵌入式瀏覽器控件使用Internet Explorer 9?
- 26. .net網頁瀏覽器控件
- 27. 如何阻止瀏覽器的
- 28. Internet Explorer和在IFRAME
- 29. 允許/阻止WinForms Web瀏覽器控件中的Cookie
- 30. 阻止瀏覽器窗口中的iframe錨定
您可以通過在某些加載/加載事件刪除iframe修改DOM。 – 2011-12-19 18:32:50
你可以鏈接我一些很好的教程或什麼?我不知道DOM – Pmillan 2011-12-19 18:34:57