Browser Agent automatic snippet insertion does not ignore commented out html code containing a "</head>" or "<body>" tag and can therefore break an application.

Document ID : KB000046159
Last Modified Date : 14/02/2018
Show Technical Document Details

Problem:

Browser Agent automatic snippet insertion does not ignore commented html code containing a "</head>" or "<body>" tag. It can therefore break an application where such commented code exists.

 

Environment:

APM 10.1,10.2,10.3

 

Resolution:

As of APM 10.3 the Browser Agent automatic snippet insertion follows these rules: 

1. If page content type is text/html and if page contains </head> tag, the snippet is inserted right in front of </head> tag. 

2. If page content type is text/html and if page does not contain </head> tag but it contains <body> tag, the snippet with <head> and </head> tags is inserted right in front of the <body> tag. 

3. If page content type is text/html and if page does not contain </head> or <body> tag, the snippet is not inserted. 

4. If page content type is not text/html, the snippet is not inserted. 

5. The current design searches for </head> and <body> in plain text format and commented code is not ignored. To reduce the performance overhead it does not use any html parser to extract fields, and also the search stops when first match is found. 

 

Additional Information:

The ignoring of commented </head> and <body> tags for snippet insertion is planned for a future release of the product.