Enter Case number reference for associated cases.

Case #

Type: APM as a Service

Include any information that is for INTERNAL use only

Detail the contextual information specific to the issue; i.e. Product, Version, Agent, System, etc.

  • Dynatrace Recorder

Describe the problem, from the user perspective

I need to create a script on my web site. The site pops up a new window during a business transaction. The target window's value for the popup window is dynamic. How can I get the popup window's number?

Clearly list the Steps to resolve the issue

Use JavaScript, such as the following example, in a Custom action to get the popup window's number. For details, see the help pages Custom Actions and Editing Script Actions.

var popups = external.getPopups(); 
// for IE var popups = window.external.getPopups(); 
alert("Popups: "+popups.count()); 
for (var i=0;i<popups.count();i++) { 
alert("popup "+i+" name: "+popups.get(i).name + ": " + popups.get(i).document.title); 
if (popups.get(i).document.title.indexOf("Money Manager - GPS") > -1) { 
newWindow = "gomez_top["+(i+1)+"]"; 
//return; 
} 
}