JDK-6796260 : proxy.pac file fails to be evaluated when JScript alert() function is used
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u11,7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows,windows_xp
  • CPU: generic,x86
  • Submitted: 2009-01-21
  • Updated: 2013-11-25
  • Resolved: 2012-06-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u6Fixed 8 b43Fixed
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