beforeunload safari iframe issue
<p><strong>sample.html</strong></p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
window.onbeforeunload = function (e) {
  e = e || window.event;

  // For IE and Firefox prior to version 4
  if (e) {
    e.returnValue = 'Any string';
  }

  // For Safari
  return 'Any string';
};

&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt; &lt;a href="http://www.yahoo.com"&gt; Yahoo&lt;/a&gt; &lt;/h1&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>main.html</strong></p>

<pre><code>&lt;html&gt;
&lt;body&gt;

&lt;iframe src="sample.html" width="100%" height="300"&gt;
  &lt;p&gt;Your browser does not support iframes.&lt;/p&gt;
&lt;/iframe&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>so the issue is when I am clicking on yahoo link onbeforeunload function is not getting called.</p>
