Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 277780

Summary: ExternalBrowser open url problem in IE
Product: [RT] RAP Reporter: Cheney Mising name <batxut>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: ivan, ruediger.herrmann
Version: 1.2   
Target Milestone: 1.3 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Snippet none

Description Cheney Mising name CLA 2009-05-25 21:54:53 EDT
Environment:
IE 7.0.5730.13 on Windows XP Professional SP3 5.1.2600.5512 (xpsp.080413-2111)
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.13) Gecko/20080316 SUSE/2.0.0.13-0.1 Firefox/2.0.0.13 GTB5

RAP Build ID:RAP1.2.0-RC1-20090519-1552

Steps to reproduce:
Use the the ExternalBrowser to open url for user downlading files in application, show as below:
while (iterator.hasNext()) {
        String downloadUrl = iterator.next();
        if (downloadUrl != null && !downloadUrl.equals("")) {
                ExternalBrowser.open("" + downloadUrl.hashCode(),
downloadUrl,ExternalBrowser.LOCATION_BAR);
        }
}
the url parameter passed to ExternalBrowser like
as:http://localhost:9090/download/12422078509457471471.xls

Result:
In firefox, the application works fine that shows the file save dialogs for
user.But in IE6/IE7,when the application try to open browser with the given
url, the browser shows the js error.

More information:
the browser shows the error:

Could not evaluate javascript response:parameter
invalid.  org.eclipse.swt.EventUtil.suspendEventHandling();var req =
org.eclipse.swt.Request.getInstance();req.setRequestCounter( "20" );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.EventUtil.resumeEventHandling();org.eclipse.rwt.widgets.ExternalBrowser.open( "-118096232", "http://localhost/download/12432249757940252628.xls", "dependent=1,scrollbars=1,resizable=1,status=0,location=1,toolbar=0,menubar=0" );org.eclipse.rwt.widgets.ExternalBrowser.open( "1118391091", "http://localhost/download/12432249842090825262.xls", "dependent=1,scrollbars=1,resizable=1,status=0,location=1,toolbar=0,menubar=0" );

Expected:
In IE, the application should works as well as in firefox.
Comment 1 Ivan Furnadjiev CLA 2009-05-26 08:42:32 EDT
I've tried to reproduce it. In FF it is working fine - several "Save as" dialogs pop-ups. In IE8 the browser window pop-ups and closes immediately, but there is no js error. Can you provide a simple project that demonstrate the bug (javascript error)? 
Comment 2 Cheney Mising name CLA 2009-05-28 23:28:53 EDT
OK, But I didn't test it in IE8, I test it in IE7, can you please test it in IE7?

As you said:In IE8 the browser window pop-ups and closes immediately, but
there is no js error. So the problem is also exist in IE8, Because the browser window pop-ups and closes immediately, I cant's use "Save as" dialog to save the  file in my local computer and the behavior in IE8 is not the same in FF.
Comment 3 Ivan Furnadjiev CLA 2009-05-29 02:44:02 EDT
Hi Cheney, in IE 7 it is slower, but behaves exactly the same as in FF. That's why I ask you for a snippet that demonstrate the javascript error.
Comment 4 Igor Pavlenko CLA 2009-11-10 02:13:05 EST
Created attachment 151773 [details]
Snippet

I reproduced this problem in IE8. It is in ExternalBrowser.js code. The problem is in the second argument of the window.open function.

I attached an html-file that can help to reproduce a similar problem without RAP. Try to open it: you will get an JS error. Change the second argument to null (or only remove the '-'-sign) at it will work fine.

It seems like IE doesn't allow a minus sign in window names.

P.S. I do not know if this problem still actual because I use my own modification of the 1.2.
Comment 5 Ivan Furnadjiev CLA 2009-11-11 07:19:11 EST
Thanks, Igor. Fixed by escaping the '-' character in window id. Cheney, please reopen if the bug persist.