How do I sandbox a web browser control in C#? -
i using web browser control view cached web pages "offline". problem running when load page, links want fetch data internet.
i not interested in "filling in blanks" allowing page fulfill requests. interested in viewing web page "as is" without downloading missing pieces.
the existing events in web browser control not provide simple way block these requests. did try using "progresschanged" event has arguments number of bytes being downloaded (eg: e.currentprogress, e.maximumprogess). if place "mybrowser.stop()" statement in there, works no means 100%.
i looking event handler or api allow me block outgoing requests altogether -- or -- @ least prevent downloaded affecting original html document.
i found 1 suggestion of using shdocvw's filedownload event handler use test see if activedocument = true. if false, cancel event. got pretty close implementing along lines when came writing event handler, not find relevant filedownloadeventargs handler.
i appreciate someone's on this.
parse static content , remove script, style, , link elements, element src
or href
should have attributes set null. prevent content being fetched.
Comments
Post a Comment