views:

406

answers:

3

Greetings,

We're about to launch a secured site (sorry, no URL) and have caught a rather esoteric bug in IE6 that I'm hoping someone might have encountered or be able to shed some light on. This only occurs when three factors are present:

  1. The browser is IE6 (it's a financial client, and that's their approved browser)
  2. SWFAddress is being used in the page, which is all Flash
  3. void(0) is called from a browser bookmark with the value set to a JavaScript string

If you're familiar with Instapaper's "Read Later" bookmarklet, which launches a popup window with a Read Later button to submit the URL you were viewing to their site to log, it's the same premise.

This works on any other URL in the parent window that I've tested. It only fails when the SWF updates the browser history/URL using SWFAddress, which is a requirement as that's the deep-link URL we're trying to capture with the bookmarklet tool.

As I understand it, the JavaScript string needs to end in void(0) so that the parent window does not navigate to the JavaScript string. This is typical of the old school application of JavaScript in an href attribute.

We're seeing two things:

  1. After the first time you open the new browser window with the JS code in the bookmark, SWFAddress no longer updates the browser history/URL bar.
  2. After you submit and close the new browser window, which has a form in it, subsequent opening of the window via the bookmark ignores the void(0) and redirects the parent window.

Here's the bookmark code:

javascript:var%20d=document;w=window,f='http://mydomain.com/popup?l=',l=d.location,e=encodeURI,p=e(l.href),u=f+p;s=p.split('/');if(s[3]=='p'||s[3]=='t')u=u+'&p='+s[5];w.open(u,'p','toolbar=0,menubar=0,directories=0,personalbar=0,resizable=0,status=1,width=300,height=460');void(0);

The Flash piece is managed by another vendor, so I have no control or insight into their code. I'm really just trying to float this issue to see if anyone has encountered such issues with this set of factors.

Thanks much, Mark

A: 

Hello You can try this

<a href='#' onclick='document;w=window,f='http://mydomain.com/popup?l=',l=d.location,e=encodeURI,p=e(l.href),u=f+p;s=p.split('/');if(s[3]=='p'||s[3]=='t')u=u+'&amp;p='+s[5];w.open(u,'p','toolbar=0,menubar=0,directories=0,personalbar=0,resizable=0,status=1,width=300,height=460');'&gt;click to visit</a>
streetparade
Thanks for the reply. Unfortunately the requirements dictate that the link reside in the browser chrome and be accessible in multiple instances consistently, hence the bookmark-driven link.I may try your suggestion in the page loading the SWF to try to narrow down the issue, but ultimately I need the bookmark JavaScript functioning without causing the parent window to navigate.
A: 

It looks like your bookmarklet has a few syntax errors and could be reduced a little bit more :

javascript:var%20f='http://mydomain.com/popup?l=',l=document.location,e=encodeURI,p=e(l.href),u=f+p,s=p.split('/');if(s[3]=='p'||s[3]=='t')u+='&amp;p='+s[5];open(u,'p','toolbar=0,menubar=0,directories=0,personalbar=0,resizable=0,status=1,width=300,height=460');void(0);

You could also try to add return false; instead of void(0);

Fabien Ménager
A: 

If you're using getURL() or navigateToUrl() then you need to know that it creates a conflict with SWFAddress. Check http://www.asual.com/blog/swfaddress/2007/05/18/swfaddress-bad-practices.html for explanation.

Rostislav
We did already address that one. In this case, unrelated JavaScript is impacting the SWF and/or SWFAddress. Thanks for the link, though. We'll definitely review that.