I was wondering what was the best way to detect when the page finished loading, where the page in question is in another tab or window ... and where the page to load can be any page on the Internet and not under my control.
I use only Firefox, and I do not mind if the solution requires the extension Firefox or Grease Monkey script (I already added configuration / commands to allow access to pages from different domains).
The code below shows an attempt. Sometimes it detects when the start page is loaded, but when I press submit to reload a new page in another window, it does not detect it.
Thank.
<html>
<head>
<script type="text/javascript">
currentPageObj = window.open("http://www.bbc.co.uk", "currentPage");
currentPageObj.addEventListener("load", function(){alert("loaded")}, false);
</script>
</head>
<body>
<form action="http://www.example.com" target="currentPage">
<input type="submit">
</form>
</body>
</html>