Bug 1461243 - Part 5: Stub out obsolete DOM API navigator.javaEnabled(). r=jimm r=bz
authorChris Peterson <cpeterson@mozilla.com>
Fri, 28 Apr 2017 18:54:33 -0700
changeset 472682 0124ef77616cb7221301bdc01f4699514019d376
parent 472681 5f02f3bb5c6bb0c97783c2b124857c68aa880d8e
child 472683 f5f49315fec2505facfb775a417bdcf35504b5ef
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, bz
bugs1461243
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1461243 - Part 5: Stub out obsolete DOM API navigator.javaEnabled(). r=jimm r=bz We can't remove navigator.javaEnabled() entirely because that would break any web content that tries to call the function. MozReview-Commit-ID: KIOBrZuMu9r
browser/app/profile/firefox.js
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/webidl/Navigator.webidl
modules/libpref/init/all.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -713,18 +713,16 @@ pref("plugins.show_infobar", false);
 // Should dismissing the hidden plugin infobar suppress it permanently?
 pref("plugins.remember_infobar_dismissal", true);
 
 pref("plugin.default.state", 1);
 
 // Plugins bundled in XPIs are enabled by default.
 pref("plugin.defaultXpi.state", 2);
 
-// Java is Click-to-Activate by default on all channels.
-pref("plugin.state.java", 1);
 
 // Flash is Click-to-Activate by default on all channels.
 pref("plugin.state.flash", 1);
 
 // Enables the download and use of the flash blocklists.
 pref("plugins.flashBlock.enabled", true);
 
 // Prefer HTML5 video over Flash content, and don't
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -610,39 +610,16 @@ Navigator::GetDoNotTrack(nsAString &aRes
 
   if (doNotTrack) {
     aResult.AssignLiteral("1");
   } else {
     aResult.AssignLiteral("unspecified");
   }
 }
 
-bool
-Navigator::JavaEnabled(CallerType aCallerType, ErrorResult& aRv)
-{
-  // Return true if we have a handler for the java mime
-  nsAutoString javaMIME;
-  Preferences::GetString("plugin.java.mime", javaMIME);
-  NS_ENSURE_TRUE(!javaMIME.IsEmpty(), false);
-
-  if (!mMimeTypes) {
-    if (!mWindow) {
-      aRv.Throw(NS_ERROR_UNEXPECTED);
-      return false;
-    }
-    mMimeTypes = new nsMimeTypeArray(mWindow);
-  }
-
-  RefreshMIMEArray();
-
-  nsMimeType *mimeType = mMimeTypes->NamedItem(javaMIME, aCallerType);
-
-  return mimeType && mimeType->GetEnabledPlugin();
-}
-
 uint64_t
 Navigator::HardwareConcurrency()
 {
   workerinternals::RuntimeService* rts =
     workerinternals::RuntimeService::GetOrCreateService();
   if (!rts) {
     return 1;
   }
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -153,17 +153,20 @@ public:
   void GetOscpu(nsAString& aOscpu, CallerType aCallerType,
                 ErrorResult& aRv) const;
   void GetVendorSub(nsAString& aVendorSub);
   void GetVendor(nsAString& aVendor);
   void GetProductSub(nsAString& aProductSub);
   bool CookieEnabled();
   void GetBuildID(nsAString& aBuildID, CallerType aCallerType,
                   ErrorResult& aRv) const;
-  bool JavaEnabled(CallerType aCallerType, ErrorResult& aRv);
+  bool JavaEnabled()
+  {
+    return false;
+  }
   uint64_t HardwareConcurrency();
   bool TaintEnabled()
   {
     return false;
   }
   void AddIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
   void RemoveIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
 
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -181,17 +181,17 @@ partial interface Navigator {
   // WebKit/Blink supports this (hardcoded "20030107"); Trident/Presto don't
   readonly attribute DOMString productSub;
   // WebKit/Blink/Trident/Presto support this.
   readonly attribute boolean cookieEnabled;
   [Throws, Constant, Cached, NeedsCallerType]
   readonly attribute DOMString buildID;
 
   // WebKit/Blink/Trident/Presto support this.
-  [Throws, NeedsCallerType]
+  [Affects=Nothing, DependsOn=Nothing]
   boolean javaEnabled();
 
   /**
    * Navigator requests to add an idle observer to the existing window.
    */
   [Throws, ChromeOnly]
   void addIdleObserver(MozIdleObserver aIdleObserver);
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3098,21 +3098,16 @@ pref("plugins.load_appdir_plugins", fals
 pref("plugins.click_to_play", false);
 
 // This only supports one hidden ctp plugin, edit nsPluginArray.cpp if adding a second
 pref("plugins.navigator.hidden_ctp_plugin", "");
 
 // The default value for nsIPluginTag.enabledState (STATE_ENABLED = 2)
 pref("plugin.default.state", 2);
 
-// The MIME type that should bind to legacy java-specific invocations like
-// <applet> and <object data="java:foo">. Setting this to a non-java MIME type
-// is undefined behavior.
-pref("plugin.java.mime", "application/x-java-vm");
-
 // How long in minutes we will allow a plugin to work after the user has chosen
 // to allow it "now"
 pref("plugin.sessionPermissionNow.intervalInMinutes", 60);
 // How long in days we will allow a plugin to work after the user has chosen
 // to allow it persistently.
 pref("plugin.persistentPermissionAlways.intervalInDays", 90);
 
 // This pref can take 3 possible string values: