зеркало из https://github.com/mozilla/pjs.git
Merge mozilla-central and mozilla-inbound; a=me
This commit is contained in:
Коммит
0e0fa8ae0b
|
@ -112,7 +112,12 @@ var shell = {
|
|||
// a specific value when the device starts. This way the front-end
|
||||
// can display a notification when the volume change and show a volume
|
||||
// level modified from this point.
|
||||
Services.audioManager.masterVolume = 0.5;
|
||||
// try catch block must be used since the emulator fails here. bug 746429
|
||||
try {
|
||||
Services.audioManager.masterVolume = 0.5;
|
||||
} catch(e) {
|
||||
dump('Error setting master volume: ' + e + '\n');
|
||||
}
|
||||
|
||||
let domains = "";
|
||||
try {
|
||||
|
|
|
@ -7185,8 +7185,8 @@ var gPluginHandler = {
|
|||
activatePlugins: function PH_activatePlugins(aContentWindow) {
|
||||
let browser = gBrowser.getBrowserForDocument(aContentWindow.document);
|
||||
browser._clickToPlayPluginsActivated = true;
|
||||
let cwu = aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let cwu = aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let plugins = cwu.plugins;
|
||||
for (let plugin of plugins) {
|
||||
let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
|
@ -7255,10 +7255,16 @@ var gPluginHandler = {
|
|||
_handleClickToPlayEvent: function PH_handleClickToPlayEvent(aPlugin) {
|
||||
let doc = aPlugin.ownerDocument;
|
||||
let browser = gBrowser.getBrowserForDocument(doc.defaultView.top.document);
|
||||
let pluginsPermission = Services.perms.testPermission(browser.currentURI, "plugins");
|
||||
let overlay = doc.getAnonymousElementByAttribute(aPlugin, "class", "mainBox");
|
||||
|
||||
if (browser._clickToPlayPluginsActivated) {
|
||||
let objLoadingContent = aPlugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
objLoadingContent.playPlugin();
|
||||
return;
|
||||
} else if (pluginsPermission == Ci.nsIPermissionManager.DENY_ACTION) {
|
||||
overlay.style.visibility = "hidden";
|
||||
return;
|
||||
}
|
||||
|
||||
let overlay = doc.getAnonymousElementByAttribute(aPlugin, "class", "mainBox");
|
||||
|
@ -7276,26 +7282,53 @@ var gPluginHandler = {
|
|||
return;
|
||||
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
|
||||
let pluginsPermission = Services.perms.testPermission(browser.currentURI, "plugins");
|
||||
if (pluginsPermission == Ci.nsIPermissionManager.DENY_ACTION)
|
||||
return;
|
||||
|
||||
let contentWindow = browser.contentWindow;
|
||||
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
if (cwu.plugins.length)
|
||||
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let pluginNeedsActivation = cwu.plugins.some(function(plugin) {
|
||||
let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
return !objLoadingContent.activated;
|
||||
});
|
||||
if (pluginNeedsActivation)
|
||||
gPluginHandler._showClickToPlayNotification(browser);
|
||||
},
|
||||
|
||||
_showClickToPlayNotification: function PH_showClickToPlayNotification(aBrowser) {
|
||||
aBrowser._clickToPlayDoorhangerShown = true;
|
||||
let contentWindow = aBrowser.contentWindow;
|
||||
|
||||
let messageString = gNavigatorBundle.getString("activatePluginsMessage.message");
|
||||
let action = {
|
||||
let mainAction = {
|
||||
label: gNavigatorBundle.getString("activatePluginsMessage.label"),
|
||||
accessKey: gNavigatorBundle.getString("activatePluginsMessage.accesskey"),
|
||||
callback: function() { gPluginHandler.activatePlugins(contentWindow); }
|
||||
};
|
||||
let secondaryActions = [{
|
||||
label: gNavigatorBundle.getString("activatePluginsMessage.always"),
|
||||
accessKey: gNavigatorBundle.getString("activatePluginsMessage.always.accesskey"),
|
||||
callback: function () {
|
||||
Services.perms.add(aBrowser.currentURI, "plugins", Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
gPluginHandler.activatePlugins(contentWindow);
|
||||
}
|
||||
},{
|
||||
label: gNavigatorBundle.getString("activatePluginsMessage.never"),
|
||||
accessKey: gNavigatorBundle.getString("activatePluginsMessage.never.accesskey"),
|
||||
callback: function () {
|
||||
Services.perms.add(aBrowser.currentURI, "plugins", Ci.nsIPermissionManager.DENY_ACTION);
|
||||
let notification = PopupNotifications.getNotification("click-to-play-plugins", aBrowser);
|
||||
if (notification)
|
||||
notification.remove();
|
||||
}
|
||||
}];
|
||||
let options = { dismissed: true };
|
||||
PopupNotifications.show(aBrowser, "click-to-play-plugins",
|
||||
messageString, "plugins-notification-icon",
|
||||
action, null, options);
|
||||
mainAction, secondaryActions, options);
|
||||
},
|
||||
|
||||
// event listener for missing/blocklisted/outdated/carbonFailure plugins.
|
||||
|
|
|
@ -91,12 +91,14 @@
|
|||
<command id="cmd_installDef" oncommand="onCheckboxClick('install');"/>
|
||||
<command id="cmd_geoDef" oncommand="onCheckboxClick('geo');"/>
|
||||
<command id="cmd_indexedDBDef" oncommand="onCheckboxClick('indexedDB');"/>
|
||||
<command id="cmd_pluginsDef" oncommand="onCheckboxClick('plugins');"/>
|
||||
<command id="cmd_imageToggle" oncommand="onRadioClick('image');"/>
|
||||
<command id="cmd_popupToggle" oncommand="onRadioClick('popup');"/>
|
||||
<command id="cmd_cookieToggle" oncommand="onRadioClick('cookie');"/>
|
||||
<command id="cmd_installToggle" oncommand="onRadioClick('install');"/>
|
||||
<command id="cmd_geoToggle" oncommand="onRadioClick('geo');"/>
|
||||
<command id="cmd_indexedDBToggle" oncommand="onRadioClick('indexedDB');"/>
|
||||
<command id="cmd_pluginsToggle" oncommand="onRadioClick('plugins');"/>
|
||||
</commandset>
|
||||
|
||||
<keyset>
|
||||
|
@ -402,6 +404,18 @@
|
|||
</radiogroup>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<vbox class="permission" id="permPluginsRow">
|
||||
<label class="permissionLabel" id="permPluginsLabel"
|
||||
value="&permPlugins;" control="pluginsRadioGroup"/>
|
||||
<hbox role="group" aria-labelledby="permPluginsLabel">
|
||||
<checkbox id="pluginsDef" command="cmd_pluginsDef" label="&permAskAlways;"/>
|
||||
<spacer flex="1"/>
|
||||
<radiogroup id="pluginsRadioGroup" orient="horizontal">
|
||||
<radio id="plugins#1" command="cmd_pluginsToggle" label="&permAllow;"/>
|
||||
<radio id="plugins#2" command="cmd_pluginsToggle" label="&permBlock;"/>
|
||||
</radiogroup>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
||||
|
|
|
@ -82,6 +82,12 @@ var gPermObj = {
|
|||
indexedDB: function getIndexedDBDefaultPermissions()
|
||||
{
|
||||
return BLOCK;
|
||||
},
|
||||
plugins: function getPluginsDefaultPermissions()
|
||||
{
|
||||
if (gPrefs.getBoolPref("plugins.click_to_play"))
|
||||
return BLOCK;
|
||||
return ALLOW;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -133,6 +139,9 @@ function onUnloadPermission()
|
|||
|
||||
function initRow(aPartId)
|
||||
{
|
||||
if (aPartId == "plugins" && !gPrefs.getBoolPref("plugins.click_to_play"))
|
||||
document.getElementById("permPluginsRow").hidden = true;
|
||||
|
||||
var permissionManager = Components.classes[PERMISSION_CONTRACTID]
|
||||
.getService(nsIPermissionManager);
|
||||
|
||||
|
|
|
@ -251,6 +251,8 @@ _BROWSER_FILES = \
|
|||
plugin_test3.html \
|
||||
plugin_both.html \
|
||||
plugin_both2.html \
|
||||
plugin_clickToPlayAllow.html \
|
||||
plugin_clickToPlayDeny.html \
|
||||
alltabslistener.html \
|
||||
zoom_test.html \
|
||||
dummy_page.html \
|
||||
|
|
|
@ -230,12 +230,12 @@ function test9a() {
|
|||
var rect = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox").getBoundingClientRect();
|
||||
ok(rect.width == 200, "Test 9a, Plugin with id=" + plugin.id + " overlay rect should have 200px width before being clicked");
|
||||
ok(rect.height == 200, "Test 9a, Plugin with id=" + plugin.id + " overlay rect should have 200px height before being clicked");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "Test 9a, Plugin with id=" + plugin.id + " should not be activated");
|
||||
});
|
||||
|
||||
EventUtils.synthesizeMouse(plugin1, 100, 100, { });
|
||||
setTimeout(test9b, 0);
|
||||
setTimeout(test9b, 1000);
|
||||
}
|
||||
|
||||
// Tests that activating one click-to-play plugin will activate the other plugins (part 2/2)
|
||||
|
@ -254,7 +254,7 @@ function test9b() {
|
|||
var pluginRect = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox").getBoundingClientRect();
|
||||
ok(pluginRect.width == 0, "Test 9b, Plugin with id=" + plugin.id + " should have click-to-play overlay with zero width");
|
||||
ok(pluginRect.height == 0, "Test 9b, Plugin with id=" + plugin.id + " should have click-to-play overlay with zero height");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(objLoadingContent.activated, "Test 9b, Plugin with id=" + plugin.id + " should be activated");
|
||||
});
|
||||
|
||||
|
@ -270,8 +270,8 @@ function test10a() {
|
|||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(popupNotification, "Test 10a, Should have a click-to-play notification");
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "Test 10c, Plugin should not be activated");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "Test 10a, Plugin should not be activated");
|
||||
|
||||
popupNotification.mainAction.callback();
|
||||
setTimeout(test10b, 0);
|
||||
|
@ -280,13 +280,13 @@ function test10a() {
|
|||
// Tests that activating a hidden click-to-play plugin through the notification works (part 2/2)
|
||||
function test10b() {
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(objLoadingContent.activated, "Test 10c, Plugin should be activated");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(objLoadingContent.activated, "Test 10b, Plugin should be activated");
|
||||
|
||||
prepareTest(test11a, gTestRoot + "plugin_test3.html");
|
||||
}
|
||||
|
||||
// Tests that the going back will reshow the notification for click-to-play plugins (part 1/3)
|
||||
// Tests that the going back will reshow the notification for click-to-play plugins (part 1/4)
|
||||
function test11a() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(popupNotification, "Test 11a, Should have a click-to-play notification");
|
||||
|
@ -294,26 +294,118 @@ function test11a() {
|
|||
prepareTest(test11b, "about:blank");
|
||||
}
|
||||
|
||||
// Tests that the going back will reshow the notification for click-to-play plugins (part 2/3)
|
||||
// Tests that the going back will reshow the notification for click-to-play plugins (part 2/4)
|
||||
function test11b() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(!popupNotification, "Test 11b, Should not have a click-to-play notification");
|
||||
|
||||
gTestBrowser.addEventListener("pageshow", test11c, false);
|
||||
Services.obs.addObserver(test11d, "PopupNotifications-updateNotShowing", false);
|
||||
//gTestBrowser.addEventListener("pageshow", test11c, false);
|
||||
gTestBrowser.contentWindow.history.back();
|
||||
}
|
||||
|
||||
// Tests that the going back will reshow the notification for click-to-play plugins (part 3/3)
|
||||
// Tests that the going back will reshow the notification for click-to-play plugins (part 3/4)
|
||||
function test11c() {
|
||||
gTestBrowser.removeEventListener("pageshow", test11c, false);
|
||||
// Make sure that the event handlers for pageshow can execute before checking for their effects.
|
||||
executeSoon(function() {
|
||||
todo(false, "The following test that checks for the notification fails intermittently, bug 742619.");
|
||||
//var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
//ok(popupNotification, "Test 11c, Should have a click-to-play notification");
|
||||
Services.obs.addObserver(test11d, "PopupNotifications-updateNotShowing", false);
|
||||
}
|
||||
|
||||
// Tests that the going back will reshow the notification for click-to-play plugins (part 4/4)
|
||||
function test11d() {
|
||||
Services.obs.removeObserver(test11d, "PopupNotifications-updateNotShowing", false);
|
||||
setTimeout(function() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(popupNotification, "Test 11d, Should have a click-to-play notification");
|
||||
is(gClickToPlayPluginActualEvents, gClickToPlayPluginExpectedEvents,
|
||||
"There should be a PluginClickToPlay event for each plugin that was " +
|
||||
"blocked due to the plugins.click_to_play pref");
|
||||
finishTest();
|
||||
});
|
||||
|
||||
prepareTest(test12a, gTestRoot + "plugin_clickToPlayAllow.html");
|
||||
}, 1000);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Tests that the "Allow Always" permission works for click-to-play plugins (part 1/3)
|
||||
function test12a() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(popupNotification, "Test 12a, Should have a click-to-play notification");
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "Test 12a, Plugin should not be activated");
|
||||
|
||||
// Simulate clicking the "Allow Always" button.
|
||||
popupNotification.secondaryActions[0].callback();
|
||||
setTimeout(test12b, 0);
|
||||
}
|
||||
|
||||
// Tests that the "Always" permission works for click-to-play plugins (part 2/3)
|
||||
function test12b() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(!popupNotification, "Test 12b, Should not have a click-to-play notification");
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(objLoadingContent.activated, "Test 12b, Plugin should be activated");
|
||||
|
||||
prepareTest(test12c, gTestRoot + "plugin_clickToPlayAllow.html");
|
||||
}
|
||||
|
||||
// Tests that the "Always" permission works for click-to-play plugins (part 3/3)
|
||||
function test12c() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(!popupNotification, "Test 12c, Should not have a click-to-play notification");
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(objLoadingContent.activated, "Test 12c, Plugin should be activated");
|
||||
|
||||
Services.perms.removeAll();
|
||||
gNextTest = test13a;
|
||||
gTestBrowser.reload();
|
||||
}
|
||||
|
||||
// Tests that the "Deny Always" permission works for click-to-play plugins (part 1/3)
|
||||
function test13a() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(popupNotification, "Test 13a, Should have a click-to-play notification");
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "Test 13a, Plugin should not be activated");
|
||||
|
||||
// Simulate clicking the "Deny Always" button.
|
||||
popupNotification.secondaryActions[1].callback();
|
||||
setTimeout(test13b, 0);
|
||||
}
|
||||
|
||||
// Tests that the "Deny Always" permission works for click-to-play plugins (part 2/3)
|
||||
function test13b() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(!popupNotification, "Test 13b, Should not have a click-to-play notification");
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "Test 13b, Plugin should not be activated");
|
||||
|
||||
gNextTest = test13c;
|
||||
gTestBrowser.reload();
|
||||
}
|
||||
|
||||
// Tests that the "Deny Always" permission works for click-to-play plugins (part 3/3)
|
||||
function test13c() {
|
||||
var popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
|
||||
ok(!popupNotification, "Test 13c, Should not have a click-to-play notification");
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "Test 13c, Plugin should not be activated");
|
||||
|
||||
Services.perms.removeAll();
|
||||
Services.prefs.setBoolPref("plugins.click_to_play", false);
|
||||
prepareTest(test14, gTestRoot + "plugin_test2.html");
|
||||
}
|
||||
|
||||
// Tests that the plugin's "activated" property is true for working plugins with click-to-play disabled.
|
||||
function test14() {
|
||||
var plugin = gTestBrowser.contentDocument.getElementById("test");
|
||||
var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(objLoadingContent.activated, "Test 14, Plugin should be activated");
|
||||
|
||||
finishTest();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<embed id="test" style="width: 200px; height: 200px" type="application/x-test">
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<embed id="test" style="width: 200px; height: 200px" type="application/x-test">
|
||||
</body>
|
||||
</html>
|
|
@ -353,6 +353,17 @@ let PermissionDefaults = {
|
|||
set popup(aValue) {
|
||||
let value = (aValue == this.DENY);
|
||||
Services.prefs.setBoolPref("dom.disable_open_during_load", value);
|
||||
},
|
||||
|
||||
get plugins() {
|
||||
if (Services.prefs.getBoolPref("plugins.click_to_play")) {
|
||||
return this.UNKNOWN;
|
||||
}
|
||||
return this.ALLOW;
|
||||
},
|
||||
set plugins(aValue) {
|
||||
let value = (aValue != this.ALLOW);
|
||||
Services.prefs.setBoolPref("plugins.click_to_play", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -392,13 +403,18 @@ let AboutPermissions = {
|
|||
*
|
||||
* Potential future additions: "sts/use", "sts/subd"
|
||||
*/
|
||||
_supportedPermissions: ["password", "cookie", "geo", "indexedDB", "popup"],
|
||||
_supportedPermissions: ["password", "cookie", "geo", "indexedDB", "popup", "plugins"],
|
||||
|
||||
/**
|
||||
* Permissions that don't have a global "Allow" option.
|
||||
*/
|
||||
_noGlobalAllow: ["geo", "indexedDB"],
|
||||
|
||||
/**
|
||||
* Permissions that don't have a global "Deny" option.
|
||||
*/
|
||||
_noGlobalDeny: ["plugins"],
|
||||
|
||||
_stringBundle: Services.strings.
|
||||
createBundle("chrome://browser/locale/preferences/aboutPermissions.properties"),
|
||||
|
||||
|
@ -419,6 +435,7 @@ let AboutPermissions = {
|
|||
Services.prefs.addObserver("geo.enabled", this, false);
|
||||
Services.prefs.addObserver("dom.indexedDB.enabled", this, false);
|
||||
Services.prefs.addObserver("dom.disable_open_during_load", this, false);
|
||||
Services.prefs.addObserver("plugins.click_to_play", this, false);
|
||||
|
||||
Services.obs.addObserver(this, "perm-changed", false);
|
||||
Services.obs.addObserver(this, "passwordmgr-storage-changed", false);
|
||||
|
@ -439,6 +456,7 @@ let AboutPermissions = {
|
|||
Services.prefs.removeObserver("geo.enabled", this, false);
|
||||
Services.prefs.removeObserver("dom.indexedDB.enabled", this, false);
|
||||
Services.prefs.removeObserver("dom.disable_open_during_load", this, false);
|
||||
Services.prefs.removeObserver("plugins.click_to_play", this, false);
|
||||
|
||||
Services.obs.removeObserver(this, "perm-changed", false);
|
||||
Services.obs.removeObserver(this, "passwordmgr-storage-changed", false);
|
||||
|
@ -752,13 +770,23 @@ let AboutPermissions = {
|
|||
let allowItem = document.getElementById(aType + "-" + PermissionDefaults.ALLOW);
|
||||
allowItem.hidden = !this._selectedSite &&
|
||||
this._noGlobalAllow.indexOf(aType) != -1;
|
||||
let denyItem = document.getElementById(aType + "-" + PermissionDefaults.DENY);
|
||||
denyItem.hidden = !this._selectedSite &&
|
||||
this._noGlobalDeny.indexOf(aType) != -1;
|
||||
|
||||
let permissionMenulist = document.getElementById(aType + "-menulist");
|
||||
let permissionValue;
|
||||
let permissionValue;
|
||||
if (!this._selectedSite) {
|
||||
// If there is no selected site, we are updating the default permissions interface.
|
||||
permissionValue = PermissionDefaults[aType];
|
||||
if (aType == "plugins")
|
||||
document.getElementById("plugins-pref-item").hidden = false;
|
||||
} else {
|
||||
if (aType == "plugins") {
|
||||
document.getElementById("plugins-pref-item").hidden =
|
||||
!Services.prefs.getBoolPref("plugins.click_to_play");
|
||||
return;
|
||||
}
|
||||
let result = {};
|
||||
permissionValue = this._selectedSite.getPermission(aType, result) ?
|
||||
result.value : PermissionDefaults[aType];
|
||||
|
|
|
@ -223,6 +223,27 @@
|
|||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<!-- Opt-in activation of Plug-ins -->
|
||||
<hbox id="plugins-pref-item"
|
||||
class="pref-item" align="top">
|
||||
<image class="pref-icon" type="plugins"/>
|
||||
<vbox>
|
||||
<label class="pref-title" value="&plugins.label;"/>
|
||||
<hbox>
|
||||
<menulist id="plugins-menulist"
|
||||
class="pref-menulist"
|
||||
type="plugins"
|
||||
oncommand="AboutPermissions.onPermissionCommand(event);">
|
||||
<menupopup>
|
||||
<menuitem id="plugins-0" value="0" label="&permission.alwaysAsk;"/>
|
||||
<menuitem id="plugins-1" value="1" label="&permission.allow;"/>
|
||||
<menuitem id="plugins-2" value="2" label="&permission.block;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ const TEST_PERMS = {
|
|||
"cookie": PERM_ALLOW,
|
||||
"geo": PERM_UNKNOWN,
|
||||
"indexedDB": PERM_UNKNOWN,
|
||||
"popup": PERM_DENY
|
||||
"popup": PERM_DENY,
|
||||
"plugins" : PERM_ALLOW
|
||||
};
|
||||
|
||||
const NO_GLOBAL_ALLOW = [
|
||||
|
@ -30,7 +31,7 @@ const NO_GLOBAL_ALLOW = [
|
|||
];
|
||||
|
||||
// number of managed permissions in the interface
|
||||
const TEST_PERMS_COUNT = 5;
|
||||
const TEST_PERMS_COUNT = 6;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
|
|
@ -118,6 +118,10 @@ carbonFailurePluginsMessage.restartButton.accesskey=R
|
|||
activatePluginsMessage.message=Would you like to activate the plugins on this page?
|
||||
activatePluginsMessage.label=Activate plugins
|
||||
activatePluginsMessage.accesskey=A
|
||||
activatePluginsMessage.always=Always activate plugins for this site
|
||||
activatePluginsMessage.always.accesskey=c
|
||||
activatePluginsMessage.never=Never activate plugins for this site
|
||||
activatePluginsMessage.never.accesskey=N
|
||||
|
||||
# Sanitize
|
||||
# LOCALIZATION NOTE (sanitizeDialog2.everything.title): When "Time range to
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
<!ENTITY permCookie "Set Cookies">
|
||||
<!ENTITY permInstall "Install Extensions or Themes">
|
||||
<!ENTITY permGeo "Share Location">
|
||||
<!ENTITY permPlugins "Activate Plugins">
|
||||
|
||||
<!ENTITY permIndexedDB "Maintain Offline Storage">
|
||||
<!ENTITY permClearStorage "Clear Storage">
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
<!ENTITY geo.label "Share Location">
|
||||
|
||||
<!ENTITY plugins.label "Plugins">
|
||||
|
||||
<!-- LOCALIZATION NOTE (indexedDB.label): This is describing indexedDB storage
|
||||
using the same language used for the permIndexedDB string in browser/pageInfo.dtd -->
|
||||
<!ENTITY indexedDB.label "Maintain Offline Storage">
|
||||
|
|
|
@ -92,11 +92,11 @@
|
|||
}
|
||||
|
||||
#nav-bar:not(:-moz-lwtheme),
|
||||
#nav-bar[collapsed="true"] + toolbar:not(:-moz-lwtheme),
|
||||
#nav-bar[collapsed="true"] + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme),
|
||||
#navigator-toolbox[tabsontop="true"] > #nav-bar,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + toolbar,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + #customToolbars + #PersonalToolbar {
|
||||
#nav-bar[collapsed=true] + toolbar:not(:-moz-lwtheme),
|
||||
#nav-bar[collapsed=true] + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme),
|
||||
#nav-bar[tabsontop=true],
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar,
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar {
|
||||
background-image: -moz-linear-gradient(@toolbarHighlight@, rgba(255,255,255,0));
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,9 @@
|
|||
.pref-icon[type="image"] {
|
||||
list-style-image: url(chrome://global/skin/icons/question-64.png);
|
||||
}
|
||||
.pref-icon[type="plugins"] {
|
||||
list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png);
|
||||
}
|
||||
|
||||
.pref-title {
|
||||
font-size: 125%;
|
||||
|
|
|
@ -111,9 +111,9 @@ toolbar[mode="full"] toolbarseparator {
|
|||
border-bottom: 1px solid rgba(0, 0, 0, 0.57);
|
||||
}
|
||||
|
||||
#navigator-toolbox[tabsontop="true"] > #nav-bar,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + toolbar,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + #customToolbars + #PersonalToolbar {
|
||||
#nav-bar[tabsontop=true],
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar,
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar {
|
||||
-moz-appearance: none;
|
||||
margin-top: 0; /* don't overlay the bottom border of the tabs toolbar */
|
||||
padding-top: 4px !important;
|
||||
|
@ -124,17 +124,17 @@ toolbar[mode="full"] toolbarseparator {
|
|||
}
|
||||
|
||||
#PersonalToolbar:-moz-lwtheme,
|
||||
#navigator-toolbox[tabsontop="true"] > #nav-bar:-moz-lwtheme,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + toolbar:-moz-lwtheme,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + #customToolbars + #PersonalToolbar:-moz-lwtheme {
|
||||
#nav-bar[tabsontop=true]:-moz-lwtheme,
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar:-moz-lwtheme,
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar:-moz-lwtheme {
|
||||
background-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
#PersonalToolbar:not(:-moz-lwtheme):-moz-window-inactive,
|
||||
#navigator-toolbox[tabsontop="true"] > #nav-bar:not(:-moz-lwtheme):-moz-window-inactive,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + toolbar:not(:-moz-lwtheme):-moz-window-inactive,
|
||||
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme):-moz-window-inactive {
|
||||
#nav-bar[tabsontop=true]:not(:-moz-lwtheme):-moz-window-inactive,
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar:not(:-moz-lwtheme):-moz-window-inactive,
|
||||
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme):-moz-window-inactive {
|
||||
background-color: -moz-mac-chrome-inactive;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.32);
|
||||
}
|
||||
|
|
|
@ -91,6 +91,9 @@
|
|||
.pref-icon[type="image"] {
|
||||
list-style-image: url(chrome://global/skin/icons/question-64.png);
|
||||
}
|
||||
.pref-icon[type="plugins"] {
|
||||
list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png);
|
||||
}
|
||||
|
||||
.pref-title {
|
||||
font-size: 125%;
|
||||
|
|
|
@ -90,6 +90,9 @@
|
|||
.pref-icon[type="image"] {
|
||||
list-style-image: url(chrome://global/skin/icons/question-64.png);
|
||||
}
|
||||
.pref-icon[type="plugins"] {
|
||||
list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png);
|
||||
}
|
||||
|
||||
.pref-title {
|
||||
font-size: 125%;
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "nsEventStates.h"
|
||||
#include "nsIObjectFrame.h"
|
||||
#include "nsIPluginDocument.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsPluginHost.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
|
@ -514,7 +515,31 @@ nsresult nsObjectLoadingContent::IsPluginEnabledForType(const nsCString& aMIMETy
|
|||
}
|
||||
|
||||
if (!mShouldPlay) {
|
||||
return NS_ERROR_PLUGIN_CLICKTOPLAY;
|
||||
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIObjectLoadingContent*>(this));
|
||||
MOZ_ASSERT(thisContent);
|
||||
nsIDocument* ownerDoc = thisContent->OwnerDoc();
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> topWindow;
|
||||
rv = ownerDoc->GetWindow()->GetTop(getter_AddRefs(topWindow));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIDOMDocument> topDocument;
|
||||
rv = topWindow->GetDocument(getter_AddRefs(topDocument));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIDocument> topDoc = do_QueryInterface(topDocument);
|
||||
nsIURI* topUri = topDoc->GetDocumentURI();
|
||||
|
||||
nsCOMPtr<nsIPermissionManager> permissionManager = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
PRUint32 permission;
|
||||
rv = permissionManager->TestPermission(topUri,
|
||||
"plugins",
|
||||
&permission);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (permission == nsIPermissionManager::ALLOW_ACTION) {
|
||||
mShouldPlay = true;
|
||||
} else {
|
||||
return NS_ERROR_PLUGIN_CLICKTOPLAY;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -715,6 +740,7 @@ nsObjectLoadingContent::InstantiatePluginInstance(const char* aMimeType, nsIURI*
|
|||
}
|
||||
}
|
||||
|
||||
mActivated = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2253,7 +2279,6 @@ nsObjectLoadingContent::PlayPlugin()
|
|||
return NS_OK;
|
||||
|
||||
mShouldPlay = true;
|
||||
mActivated = true;
|
||||
return LoadObject(mURI, true, mContentType, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "z";
|
||||
src: url(invalid);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function boom()
|
||||
{
|
||||
var ctx = document.querySelector("canvas").getContext('2d');
|
||||
ctx.font = "10px serif";
|
||||
document.querySelector("style").appendChild(document.createTextNode(" "));
|
||||
ctx.measureText("123");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="boom();">
|
||||
<canvas width="100" height="100"></canvas>
|
||||
</body>
|
||||
</html>
|
|
@ -5,3 +5,4 @@ load 647480.html
|
|||
load 0px-size-font-667225.html
|
||||
load texImage2D.html
|
||||
load 729116.html
|
||||
load 745699-1.html
|
||||
|
|
|
@ -2753,6 +2753,7 @@ struct NS_STACK_CLASS nsCanvasBidiProcessor : public nsBidiPresUtils::BidiProces
|
|||
{
|
||||
virtual void SetText(const PRUnichar* text, PRInt32 length, nsBidiDirection direction)
|
||||
{
|
||||
mFontgrp->UpdateFontList(); // ensure user font generation is current
|
||||
mTextRun = mFontgrp->MakeTextRun(text,
|
||||
length,
|
||||
mThebes,
|
||||
|
@ -3149,6 +3150,7 @@ nsCanvasRenderingContext2D::MakeTextRun(const PRUnichar* aText,
|
|||
gfxFontGroup* currentFontStyle = GetCurrentFontStyle();
|
||||
if (!currentFontStyle)
|
||||
return nsnull;
|
||||
currentFontStyle->UpdateFontList(); // ensure user font generation is current
|
||||
return currentFontStyle->MakeTextRun(aText, aLength,
|
||||
mThebes, aAppUnitsPerDevUnit, aFlags);
|
||||
}
|
||||
|
|
|
@ -2970,6 +2970,7 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP
|
|||
|
||||
virtual void SetText(const PRUnichar* text, PRInt32 length, nsBidiDirection direction)
|
||||
{
|
||||
mFontgrp->UpdateFontList(); // ensure user font generation is current
|
||||
mTextRun = mFontgrp->MakeTextRun(text,
|
||||
length,
|
||||
mThebes,
|
||||
|
|
|
@ -155,11 +155,7 @@ public final class GeckoProfile {
|
|||
}
|
||||
|
||||
public File getFilesDir() {
|
||||
if (isOnInternalStorage()) {
|
||||
return mContext.getFilesDir();
|
||||
} else {
|
||||
return mContext.getExternalFilesDir(null);
|
||||
}
|
||||
return mContext.getFilesDir();
|
||||
}
|
||||
|
||||
private boolean isOnInternalStorage() {
|
||||
|
@ -186,16 +182,10 @@ public final class GeckoProfile {
|
|||
// check normal install directory
|
||||
moveProfilesFrom(new File("/data/data/" + mContext.getPackageName()));
|
||||
|
||||
if (isOnInternalStorage()) {
|
||||
if (Build.VERSION.SDK_INT >= 8) {
|
||||
// if we're currently on internal storage, but we're on API >= 8, so it's possible that
|
||||
// we were previously on external storage, check there for profiles to pull in
|
||||
moveProfilesFrom(mContext.getExternalFilesDir(null));
|
||||
}
|
||||
} else {
|
||||
// we're currently on external storage, but could have been on internal storage previously,
|
||||
// so pull in those profiles
|
||||
moveProfilesFrom(mContext.getFilesDir());
|
||||
if (Build.VERSION.SDK_INT >= 8) {
|
||||
// if we're on API >= 8, it's possible that
|
||||
// we were previously on external storage, check there for profiles to pull in
|
||||
moveProfilesFrom(mContext.getExternalFilesDir(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,7 +199,6 @@ public final class GeckoProfile {
|
|||
}
|
||||
|
||||
// if we get here, we know that oldMozDir exists
|
||||
|
||||
File currentMozDir;
|
||||
try {
|
||||
currentMozDir = ensureMozillaDirectory();
|
||||
|
|
|
@ -96,7 +96,8 @@
|
|||
let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils, Cr = Components.results;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
// Include the build date if this is an "a#" (nightly or aurora) build
|
||||
// Include the build date and warning about Telemetry
|
||||
// if this is an "a#" (nightly or aurora) build
|
||||
#expand const version = "__MOZ_APP_VERSION__";
|
||||
if (/a\d+$/.test(version)) {
|
||||
let buildID = Services.appinfo.appBuildID;
|
||||
|
@ -106,6 +107,7 @@
|
|||
versionPara.appendChild(br);
|
||||
let date = document.createTextNode("(" + buildDate + ")");
|
||||
versionPara.appendChild(date);
|
||||
document.getElementById("aboutTelemetry").hidden = false;
|
||||
}
|
||||
|
||||
// get URLs from prefs
|
||||
|
@ -248,12 +250,6 @@
|
|||
}, 2000);
|
||||
}
|
||||
#endif
|
||||
// Display warning about telemetry
|
||||
// if this is an "a#" (Nightly or Aurora) build
|
||||
let version = Services.appinfo.version;
|
||||
if (/a\d+$/.test(version)) {
|
||||
document.getElementById("aboutTelemetry").hidden = false;
|
||||
}
|
||||
]]></script>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -335,7 +335,8 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
|
|||
// If we are OOM killed with the disk cache enabled, the entire
|
||||
// cache will be cleared (bug 105843), so shut down the cache here
|
||||
// and re-init on resume
|
||||
nsCacheService::GlobalInstance()->Shutdown();
|
||||
if (nsCacheService::GlobalInstance())
|
||||
nsCacheService::GlobalInstance()->Shutdown();
|
||||
}
|
||||
|
||||
// We really want to send a notification like profile-before-change,
|
||||
|
@ -467,7 +468,8 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
|
|||
// If we are OOM killed with the disk cache enabled, the entire
|
||||
// cache will be cleared (bug 105843), so shut down cache on pause
|
||||
// and re-init here
|
||||
nsCacheService::GlobalInstance()->Init();
|
||||
if (nsCacheService::GlobalInstance())
|
||||
nsCacheService::GlobalInstance()->Init();
|
||||
|
||||
// We didn't return from one of our own activities, so restore
|
||||
// to foreground status
|
||||
|
|
Загрузка…
Ссылка в новой задаче