Saturday, March 24, 2012

about:blank SSL warning in Sys.UI.PopupBehavior.show()

While using Atlas on an SSL-secured site, PopupBehavior.show() causes IE 7 to display an SSL warning. This happens because IE does not consider "about:blank" a secure site. This probably affects IE 6 as well, though I haven't tried it.

The offending code is in the vicinity of line #8679 in the Atlas debug javascript file WebResource.axd (I think I have the most recent version):

if ((Sys.Runtime.get_hostType() == Sys.HostType.InternetExplorer) && !window.opera) {
var childFrame = elt._hideWindowedElementsIFrame;
if (!childFrame) {
childFrame = document.createElement("iframe");
childFrame.src = "about:blank";
...

This problem was manifesting itself when trying to show a PopupControl in the Atlas control toolkit, but the problem's with the Atlas core javascript, not the control toolkit.

As a workaround (since fortunately we can compile the control toolkit from sources), I changed the showPopup method in PopupControlBehavior.js to temporarily impersonate Opera and thus avoid the if-statement shown above:

window.opera = true;
_popupBehavior.show();
window.opera = false;

There's also another time about:blank appears in the Atlas core javascript, in Sys.Net.IFrameExecutor.executeRequestInternal. I'm guessing it might cause a similar problem when running on a SSL secured site, though I haven't run into problems with it yet.

Hi - I have the same problem and since this is still not fixed, i will also

try tocorrect the .js file myself and then compile the microsoft.web.atlas.dll again,

can you give me some advice on that - did it work ?

Thanks


That change did work for me.

However, Internet Explorer 7 Beta 3 has apparently been corrected so that it doesn't display a security warning when accessing about:blank from a SSL-secured webpage. (I still get a warning using the PopupControl in IE7 Beta 2 though.) What browser version are you using?


Hi, thanks for the quick answer,i have to use IE 6.0, since this is the company standard,what i don't know is: how to compile the atlas dll,is the sourcecode free available ?I have seen the .js files, but they are somehow compiledinto the dll's right ? How can i change the javascript ?Thanks

That's right, the Atlas core .js files are compiled into the DLL, so it's hard to change the code there. That's why I suggest changing the source code inside the PopupControl -- it's part of the AtlasControlToolkit, for which source code is provided here:

http://www.codeplex.com/Wiki/View.aspx?ProjectName=AtlasControlToolkit

Just download the latest release, make the change to PopupControlBehavior.js as described above, and recompile. Then copy the resulting AtlasControlToolkit.dll and Microsoft.AtlasControlExtender.dll into your project ... and if all goes well, there shouldn't be any more security warnings.


To clarify, the reason I posted this thread here and not in the AtlasControlToolkit forum is that the real problem is with the Atlas core UI code. (Well, one could argue that the real problem is with IE6, but it's already released, so tough luck...) It seems like the Atlas core code should be cleaned up to not use about:blank.


Use the following in your aspx pages
<atlas:ScriptManager runat="server" ID="ScriptManager1">
<Scripts>
<atlas:ScriptReference Path="~/ScriptLibrary/Debug/Atlas.js" />
<atlas:ScriptReference Path="~/ScriptLibrary/Debug/AtlasRuntime.js" />
</Scripts>
</atlas:ScriptManager>

In Atlas.js & AtlasRuntime.js just replace about:blank with javascript:'' and you are done.
If still getting error you can write tosharma_nishant@.satyam.com

No comments:

Post a Comment