Re: modify html code on the fly
- From: chris.sell@xxxxxxxxx
- Date: Fri, 25 Apr 2008 19:49:42 -0700 (PDT)
Igor (or anyone else who might be interested),
I have another follow-up question that hopefully you can help me
with.... I am finally get back to working on this issue and am using
the sample MIME filter from microsoft's site (http://
support.microsoft.com/kb/260840) that essentially takes an xml file
and converts it to html by adding <html> to the beginning and </html>
to the end and then replacing certain characters within the xml file,
such as '<' to '<' and so on. This seemed like a perfect example to
use as a base to what I am trying which is to use a MIME filter to
intercept html and make certain changes to it, such as bleep out
certain words.
I thought I could very easily modify this example and be able to
demonstrate the concept rather quickly. But it does not work on the
browser never loads the pages, the progress bar just slowly increases
but the page never loads. Basically I did 3 things, which I thought
would be enough. First, I changed the registry code to filter html
('text/html'). This works as I can now debug and catch it as it enters
my code.... Next, I got rid of the calls to BeginXMLConversion &
EndXMLConversion which adds the <html> and </html> tags, since that is
not necessary since we are already using html files. The final part
was to get rid of the part that changes certain characters, such as
'<' and '>' as this is no longer necessary for this purpose. I
originally got rid of the call to ParseXMLIntoHTML but after it wasn't
working, I decided to go much simpler. There's a call within there
that provides the characters to replace:
TCHAR* strCharSet = _T("<>&\r");
So I just changed that to a character that should not be on a site (or
at least not on most sites)
TCHAR* strCharSet = _T("~");
Now that's it, I did nothing else. The way I see it, pages should load
and display just like normal as the filter shouldn't change the html
at all. Once I got this working, I could start working on detecting
certain words to replace. Well, this doesn't work. Making those few
changes that I just pointed out causes it not to load pages at all. I
simply compiled the example from MIMEfilt and made those few changes
but nothing. Any thoughts on what I could be doing wrong...
Any help would be appreciated!
Thanks
.
- References:
- modify html code on the fly
- From: chris . sell
- Re: modify html code on the fly
- From: Igor Tandetnik
- Re: modify html code on the fly
- From: chris . sell
- Re: modify html code on the fly
- From: Igor Tandetnik
- modify html code on the fly
- Prev by Date: Re: create new browser process and able to handle browser events
- Next by Date: how to set WebBrowser's CSS
- Previous by thread: Re: modify html code on the fly
- Next by thread: WebBrowser Control - BeforeNavigate2, HTTPXML Requests (AJAX)
- Index(es):
Relevant Pages
|
|