United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6796260 : proxy.pac file fails to be evaluated when JScript alert() function is used

Details
Type:
Bug
Submit Date:
2009-01-21
Status:
Closed
Updated Date:
2013-11-25
Project Name:
JDK
Resolved Date:
2012-06-13
Component:
deploy
OS:
windows_xp,windows
Sub-Component:
plugin
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u11,7
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
The evaluation of the "alert()" function in a proxy.pac file stopped 
working beginning with 6u10. As a result the whole proxy.pac file fails
to get evaluated.

The problem is strictly reproducible using the following experimental 
setup:

1. Use IE6 on Windows XP SP2
2. configure the use of an automatic proxy file:
IE6 -> Tools -> Internet Options... -> Connections -> LAN Settings... ->
Use automatic configuration script

The following proxy.pac file was used:

 ---------------------------------
 function FindProxyForURL(url, host)
 {
  alert("hello world");
  return "PROXY webcache:8080";
 }
 ---------------------------------

3. Start IE6 and start a Java applet from the Internet.
 Start the Java Console window in order to verify which http proxy
 was used.
 
4. Observed behavior
--------------------
4.1  1.5.0_17
-------------
 The alert window "hello world" pops up twice:

 Microsoft Internet Explorer
       hello world
           OK

 It appears that the proxy.pac file is evaluated twice.
 The proxy is correctly set to "webcache:8080".
 Everything is fine.

4.2  1.6.0_07
-------------
 The alert window "hello world" pops up once.
 It appears that the proxy.pac file is evaluated only once.
 The proxy is correctly set to "webcache:8080".
 Everything is fine.

4.3  1.6.0_10
-------------
  The alert window "hello world" is not shown. Instead the
  following error window is shown:

 Microsoft JScript runtime error 
       Object expected
         OK-button

 This error window is shown twice, suggesting that the proxy.pac 
 file is evaluated twice.
 The proxy is set to "DIRECT", which shows that the proxy.pac 
 cannot be parsed as a consequence.
 This observed behavior is identical both with New Java Plug-in and 
 Classic Java Plug-in.

4.4  1.6.0_11
-------------
 behaves identically to 1.6.0_10

                                    

Comments
regression_test_src:
http://sqe-hg.us.oracle.com/hg/index.cgi/testbase/javase/functional/8/deployment2/file/8e8f24d41db7/new_framework/tests/common/autoproxy_detect/src/AutoproxyTest.java
                                     
2013-11-25
EVALUATION

Fix is to define alert() as noop to avoid runtime errors.
                                     
2012-06-08
EVALUATION

It looks like this bug is not related to bug 6887492, which has been fixed in 6u18-rev, I have tested the new bundle and the issue is still there, this bug is happened starting JRE 6u10 with the introduction of new Java plugin.

I have de-committed it from JRE 6u20 for now due to time constraints.
                                     
2010-02-11
EVALUATION

It looks like a regression starting 6u10, it works fine with JRE 6u7 old plugin.

I have reproduce this bug in 6u14, will debug it and see what I can fix, it should be fixed in JRE 6 update release.
                                     
2009-02-27



Hardware and Software, Engineered to Work Together