commit b9496b6926087175bfe7e9f274856680c99285f2 Author: Kathy Brade brade@pearlcrescent.com Date: Fri Oct 25 13:41:30 2013 -0400
Bug #9454: The nsIPluginTag Interface was changed.
Modify torbutton_toggle_plugins() to use the new enabledState attribute if it is available (FF23 and newer). --- src/chrome/content/torbutton.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js index 2295605..0418754 100644 --- a/src/chrome/content/torbutton.js +++ b/src/chrome/content/torbutton.js @@ -1775,8 +1775,15 @@ function torbutton_toggle_plugins(disable_plugins) { var PH=Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost); var P=PH.getPluginTags({}); for(var i=0; i<P.length; i++) { - if (P[i].disabled != disable_plugins) + if ("enabledState" in P[i]) { + var isDisabled = (P[i].enabledState == Ci.nsIPluginTag.STATE_DISABLED); + if (!isDisabled && disable_plugins) + P[i].enabledState = Ci.nsIPluginTag.STATE_DISABLED; + else if (isDisabled && !disable_plugins) + P[i].enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY; + } else if (P[i].disabled != disable_plugins) { P[i].disabled=disable_plugins; + } } } }
tor-commits@lists.torproject.org