![]() |
|
![]() | ||
|
Subject:
Modification of CGI-Proxy (PERL)
Category: Computers > Programming Asked by: pcdivenii-ga List Price: $50.00 |
Posted:
21 Jan 2003 15:34 PST
Expires: 29 Jan 2003 09:18 PST Question ID: 146715 |
I am using James Marshall's CGI-Proxy http://www.jmarshall.com/tools/cgiproxy/. I would like to use the script to specifically replace the following JavaScript in all HTML pages processed through the CGI-Proxy: if(parent.frames.length!=0)top.location='whatever.html'; I do not want to disable JavaScript entirely in the post-processed HTML pages, I just want to get rid of the above JavaScript and anything that accomplishes its function. How exactly would I go about adding this filtering element to the CGI-Proxy script? Where and how can I do this in the script? I am looking for someone who can simply modify the script for this purpose. Thank you! Any questions, please e-mail to: junkmail@patmail.com -Pat | |
| |
|
![]() | ||
|
There is no answer at this time. |
The following answer was rejected by the asker (they received a refund for the question). | |
Subject:
Re: Modification of CGI-Proxy (PERL)
Answered By: studboy-ga on 23 Jan 2003 22:37 PST |
The line of Javascript can be removed by doing a regular expression substitution right before the response is sent back to the user-- ie, add the line $body=~ s/if(parent.frames.length!=0)top.location='whatever.html';//g; to line 1540 to make it look like this: if ( $is_html && ($body ne '') && !$response_sent ) { # remove the line of Javascript $body=~ s/if(parent.frames.length!=0)top.location='whatever.html';//g; $body= &proxify_html(\$body, 1) ; # Change Content-Length header, since we changed the content $headers=~ s/^Content-Length:.*\012/ 'Content-Length: ' . length($body) . "\015\012"/mie ; | |
| |
| |
| |
|
![]() | ||
|
There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |