Popups and delays

Consider the following question.

If a web page contains java script that pops up a window after a given delay – is the content of the window loaded immediately or is it loaded after the period specified in the delay? Further if the window that is calling the popup is closed before the popup is displayed – does the popup still get displayed.

If a popup window contains an indecent graphic file, is it possible that the graphic file could be downloaded before the popup is displayed, and if so, if the user chooses to kill the page that is calling the popup *and* the act of killing the calling page forces the popup not to occur. Then is it possible for the graphic to have been downloaded but never displayed.

This breaks down into 2 questions.

  1. If a page calling a popup via some delay is closed before the popup is called then will the popup still be displayed?
  2. When is the content of a popup downloaded

a) when the parent page is parsed – but the popup is displayed after the delay specified

b) on demand after the delay specified

  1. Above is easy to test and simply involved the following java script embedded within a web page (test.htm). The script simply ‘pops up’ another page after a delay of 20 seconds. Using Internet Explorer version 6, if the page test.htm is closed before the 20 second delay has passed then the pop up does not happen.

function doPopup() {

url = "

width = 267; // width of window in pixels

height = 103; // height of window in pixels

delay = 20; // time in seconds before popup opens

timer = setTimeout("Start(url, width, height)", delay*1000);

}

</script>

<BODY OnLoad="doPopup();">

  1. In order to determine whether the popup page data was ‘prefetched’ i.e. was the data downloaded before and in readiness for the pop?. I used Ethereal to monitor the traffic across my internet connection. The following is a screen shot of a portion of the ethereal screen during the monitoring of this operation.

Line 4 shows the traffic generated when I downloaded the test web page (testb.htm) from my web server.

Line 9 shows a DNS query to determine the IP address of and is the start of the traffic sequence triggered by the popup.

Note in column 2 that the time between the request for testb.htm and the start of the DNS query is 20 seconds. This shows quite clearly that IE6 does not even try to determine the IP address of the site containing the popup until the delay period has passed. The conclusion that follows is that in the scenario detailed above, if the picture associated with the popup is present on the suspects’ machine then it is due to the activation of the code for the popup window.

Conclusion

It would seem reasonable to conclude that an image contained in a popup window would not be downloaded until the popup window itself is triggered. i.e. if there is a delay in triggering the popup then the downloading of the associated data is also delayed. Therefore the once the graphic in the above example is downloaded it is immediately rendered within its window.