<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>javascript Archives - The Story of David Kaspar</title>
	<atom:link href="https://blog.davidkaspar.com/archives/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.davidkaspar.com/archives/tag/javascript</link>
	<description>Online journal and ponderings about the Internet, gadgets and photography.</description>
	<lastBuildDate>Wed, 05 Oct 2005 08:45:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://blog.davidkaspar.com/wp-content/uploads/2020/05/chubby.gif</url>
	<title>javascript Archives - The Story of David Kaspar</title>
	<link>https://blog.davidkaspar.com/archives/tag/javascript</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>showModalDialog in Firefox and frames</title>
		<link>https://blog.davidkaspar.com/archives/2005/10/showmodaldialog-in-firefox-and-frames.php</link>
					<comments>https://blog.davidkaspar.com/archives/2005/10/showmodaldialog-in-firefox-and-frames.php#comments</comments>
		
		<dc:creator><![CDATA[David Kaspar]]></dc:creator>
		<pubDate>Wed, 05 Oct 2005 08:45:41 +0000</pubDate>
				<category><![CDATA[GreaseMonkey]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>
		<guid isPermaLink="false">https://davidkaspar.com/wp/2005/10/05/showmodaldialog-in-firefox-and-frames/</guid>

					<description><![CDATA[<p>I use Firefox exclusively and every now and then I come across a site that is crippled. This means that parts of it will not work in Firefox because the site is using some kind of IE only functionality. One example is the function showModalDialog. This will create a modal pop-up when using IE but &#8230; <a href="https://blog.davidkaspar.com/archives/2005/10/showmodaldialog-in-firefox-and-frames.php" class="more-link">Continue reading<span class="screen-reader-text"> "showModalDialog in Firefox and frames"</span></a></p>
<p>The post <a href="https://blog.davidkaspar.com/archives/2005/10/showmodaldialog-in-firefox-and-frames.php">showModalDialog in Firefox and frames</a> appeared first on <a href="https://blog.davidkaspar.com">The Story of David Kaspar</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I use Firefox exclusively and every now and then I come across a site that is crippled. This means that parts of it will not work in Firefox because the site is using some kind of IE only functionality.<br />
One example is the function <i>showModalDialog</i>. This will create a modal pop-up when using IE but because it is not a W3C standard, it is not implemented in Firefox (Mozilla) and will just cause a JavaScript error.<br />
<a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> is a very powerful extension for the Firefox browser that lets you inject your own JavaScript into any web page. This includes overriding any present functionality.<br />
While this can be used to bypass poor security implementations a far better use is to <a href="http://userscripts.org/tag/usability" title="Fix usability errors">fix usability errors</a> or <a href="http://blog.davidkaspar.com/archives/2005/10/imdb-ratings-and-links-for-myvuecom.php" title="IMDb Ratings in MyVue.com">mash together information from different sites</a>.<br />
I present you my first Greasemonkey script. It is a workaround for <i>showModaldialog</i> by replacing it with a standard <i>confirm</i> dialog: &#8220;Are you sure?&#8221;.</p>
<blockquote><p>//&nbsp;Author:&nbsp;David&nbsp;Kaspar<br />
//&nbsp;==UserScript==<br />
//&nbsp;@name&nbsp;showModaDialogFix<br />
//&nbsp;@description&nbsp;Implement&nbsp;show&nbsp;modal&nbsp;dialog&nbsp;in&nbsp;Firefox<br />
//&nbsp;@include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://&lt;enter&nbsp;your&nbsp;site(s)&nbsp;here&gt;<br />
//&nbsp;==/UserScript==<br />
window.showModalDialog&nbsp;=&nbsp;function()&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;window.confirm(&quot;Are&nbsp;you&nbsp;sure?&quot;);<br />
}</p></blockquote>
<p><a href="http://www.davidkaspar.com/gm/showModalDialogPatch.user.js"><br />
Install the script</a><br />
If the site you are visting is using frames, you may have to use the below version and insert the name of the frame that is calling the showModalDialog function:</p>
<blockquote><p>if&nbsp;(window.frames.frameNameHere)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.frames.frameNameHere.showModalDialog&nbsp;=&nbsp;function()&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;window.confirm(&quot;Are&nbsp;you&nbsp;sure?&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</p></blockquote>
<p><u>Update 04/05/2007</u><br />
No progress with Firefox modal windows so instead a work-around: forced focus on pop-up.<br />
During the latest cross browser compatibility push at our company, a team member devised this work-around and it works sufficiently in all browsers we tested (IE6, IE7, FireFox 2, Safari, Opera).<br />
The idea is to force focus on the pop-up window. This is achieved with the javascript function window.focus().<br />
This method will not work if the user has JS switched off but since JS is a basic requirement for our services, we can expect JS to always be on.</p>
<p>The post <a href="https://blog.davidkaspar.com/archives/2005/10/showmodaldialog-in-firefox-and-frames.php">showModalDialog in Firefox and frames</a> appeared first on <a href="https://blog.davidkaspar.com">The Story of David Kaspar</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidkaspar.com/archives/2005/10/showmodaldialog-in-firefox-and-frames.php/feed</wfw:commentRss>
			<slash:comments>29</slash:comments>
		
		
			</item>
	</channel>
</rss>
