Closed Bug 271098 Opened 20 years ago Closed 19 years ago

navigator.javaEnabled returns false if browser is started with java enabled

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 221080

People

(Reporter: firefox, Assigned: bugzilla)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

The navigator.javaEnabled javascript function will return false when the browser
is started with java enabled.  If java is then disabled and re-enabled, the
function correctly returns true.

Here is a small html document that can be used to reproduce the problem.

<html>
 <head>
  <title>Java Check</title>    
  <script language="JavaScript">

   function submitForm() {
    
      if (navigator.javaEnabled()){
          }
      else{
          alert("Sorry, your browser doesn't support Java.");
          return;
          }    
        
      document.userForm.submit();
   }

  </script>
 </head>
 <body>
   <form name="userForm" action="" method="post" target="_self">
    <table>
     <tr>
      <td align="left" nowrap>Customer ID:</td> 
      <td align="left">
       <input type="text" value="" name="user" maxlength="32">
      </td>
     </tr>
     <tr>
      <td colspan=2 align=center>
       <input type="button" value="Enter" onclick="submitForm();">
      </td>                                              
     </tr>
    </table>
   </form>           
</body>
</html>


Reproducible: Always
Steps to Reproduce:
1. Enable java in the browser
2. Quit the browser
3. Restart the browser
4. Load the sample document described in the Details section of the bug report
5. Enter some text and click "Enter" (java not enbled alert pops up).
6. Disable java in the browser
7. Re-enable java in the browser
8. Reload the web page
9. Enter some text and click "Enter" (no alert pops up - correct behavior)


Actual Results:  
navigator.javaEnabled does not work until java is disabled and then re-enabled.

Expected Results:  
navigator.javaEnabled should correctly report the java enabled/disabled state
after a browser restart.
Dup of Bug 97613?
This doesn't fix the underlying problem, but seems to work around it.  I don't
know enough about the inner workings of firefox, but it looks to me like
user_pref("security.enable_java", false); is (correctly) set when java is
disabled, but that line is (incorrectly?) missing when java is enabled.  The
test for JavaEnabled appears to return false if that line is missing.  Is it
possible that a line should be written into prefs.js explicitly enabling java? 
For example:  user_pref("security.enable_java", true);
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
Status: RESOLVED → UNCONFIRMED
Resolution: EXPIRED → ---

*** This bug has been marked as a duplicate of 221080 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: