An easier way to add a banner to web pages?

Asked by Jay Lorenzana on 2010-08-26

I'm trying to add a banner at the top of each webpage that pass thru our squid server. So i've taken and modified it to search for the <body> tag, then inserting html code to do just that. I had to handle iframes tags, pages with several body tags, etc., otherwise my banner would pop up in unwanted places. Problem is it works on only ~50% of the websites out there. I am left with these offending web signatures:

1) javascript code creating iframes, so when the body tags comes in I inadvertently insert the banner in that iframe. the iframe src in these instances usually have url's that are variable which means I have to start parsing javascript - yikes.
2) the banner doesn't push all web pages down reliably. Seems there are pages out there that do a lot of absolute location references.
3) .....

Is there an easier way of doing this?

Thanks in advance,

Question information

English Edit question
eCAP Edit question
No assignee Edit question
Last query:
Last reply:
Alex Rousskov (rousskov) said : #1

In my experience, there is no easy way to do reliable banner insertion. You have listed some of the problems, and there are more (e.g., content encoding and framesets). There are solutions to most of them, but some are difficult, and it is not easy to assemble all the solution together, and even after you are done, you still need to maintain a blacklist to handle exceptions.

Can you help with this problem?

Provide an answer of your own, or ask Jay Lorenzana for more information if necessary.

To post a message you must log in.