Merge mozilla-central to autoland

This commit is contained in:
Carsten "Tomcat" Book 2016-11-18 16:57:20 +01:00
Родитель 7c26ce739c 866da9f9c6
Коммит a69c372ef1
303 изменённых файлов: 20568 добавлений и 17542 удалений

Просмотреть файл

@ -479,9 +479,6 @@ setUpdateTrackingId();
// ======================= Dogfooders FOTA ==========================
if (AppConstants.MOZ_B2G_RIL) {
XPCOMUtils.defineLazyModuleGetter(this, "AppsUtils",
"resource://gre/modules/AppsUtils.jsm");
SettingsListener.observe('debug.performance_data.dogfooding', false,
isDogfooder => {
if (!isDogfooder) {
@ -498,24 +495,6 @@ if (AppConstants.MOZ_B2G_RIL) {
dump('AUS:Settings: There is no mozMobileConnections!\n');
return;
}
let conn = navigator.mozMobileConnections[0];
conn.addEventListener('radiostatechange', function onradiostatechange() {
if (conn.radioState !== 'enabled') {
return;
}
conn.removeEventListener('radiostatechange', onradiostatechange);
navigator.mozTelephony.dial('*#06#').then(call => {
return call.result.then(res => {
if (res.success && res.statusMessage
&& (res.serviceCode === 'scImei')) {
Services.prefs.setCharPref("app.update.imei_hash",
AppsUtils.computeHash(res.statusMessage, "SHA512"));
}
});
});
});
});
}

Просмотреть файл

@ -7,7 +7,6 @@
window.performance.mark('gecko-shell-loadstart');
Cu.import('resource://gre/modules/NotificationDB.jsm');
Cu.import("resource://gre/modules/AppsUtils.jsm");
Cu.import('resource://gre/modules/UserAgentOverrides.jsm');
Cu.import('resource://gre/modules/Keyboard.jsm');
Cu.import('resource://gre/modules/ErrorPage.jsm');

Просмотреть файл

@ -12,7 +12,6 @@ const Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AppsUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "gSystemMessenger",
"@mozilla.org/system-message-internal;1",

Просмотреть файл

@ -4,7 +4,6 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/AppsUtils.jsm");
function BootstrapCommandlineHandler() {
this.wrappedJSObject = this;
@ -37,11 +36,6 @@ BootstrapCommandlineHandler.prototype = {
if (!this.startManifestURL) {
return;
}
if (!isAbsoluteURI(this.startManifestURL)) {
this.bailout("The start manifest url must be absolute.");
return;
}
},
helpInfo: "--start-manifest=manifest_url",

Просмотреть файл

@ -12,7 +12,6 @@ const Cu = Components.utils;
const CC = Components.Constructor;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AppsUtils.jsm");
function debug(aMsg) {
//dump("-*- Bootstraper: " + aMsg + "\n");
@ -24,7 +23,6 @@ function debug(aMsg) {
*/
this.Bootstraper = {
_manifestURL: null,
_startupURL: null,
bailout: function(aMsg) {
dump("************************************************************\n");
@ -35,33 +33,6 @@ this.Bootstraper = {
appStartup.quit(appStartup.eForceQuit);
},
installSystemApp: function(aManifest) {
// Get the appropriate startup url from the manifest launch_path.
let base = Services.io.newURI(this._manifestURL, null, null);
let origin = base.prePath;
let helper = new ManifestHelper(aManifest, origin, this._manifestURL);
this._startupURL = helper.fullLaunchPath();
return new Promise((aResolve, aReject) => {
debug("Origin is " + origin);
let appData = {
app: {
installOrigin: origin,
origin: origin,
manifest: aManifest,
manifestURL: this._manifestURL,
manifestHash: AppsUtils.computeHash(JSON.stringify(aManifest)),
appStatus: Ci.nsIPrincipal.APP_STATUS_CERTIFIED
},
appId: 1,
isBrowser: false,
isPackage: false
};
//DOMApplicationRegistry.confirmInstall(appData, null, aResolve);
});
},
/**
* Resolves to a json manifest.
*/
@ -90,9 +61,8 @@ this.Bootstraper = {
},
configure: function() {
debug("Setting startup prefs... " + this._startupURL);
Services.prefs.setCharPref("b2g.system_manifest_url", this._manifestURL);
Services.prefs.setCharPref("b2g.system_startup_url", this._startupURL);
Services.prefs.setCharPref("b2g.system_startup_url", "");
return Promise.resolve();
},
@ -147,7 +117,6 @@ this.Bootstraper = {
return new Promise((aResolve, aReject) => {
this.uninstallPreviousSystemApp.bind(this)
.then(this.loadManifest.bind(this))
.then(this.installSystemApp.bind(this))
.then(this.configure.bind(this))
.then(aResolve)
.catch(aReject);

Просмотреть файл

@ -24,7 +24,6 @@ const ALLOW_MULTIPLE_REQUESTS = ["audio-capture", "video-capture"];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AppsUtils.jsm");
Cu.import("resource://gre/modules/PermissionsTable.jsm");
var permissionManager = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager);

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<blocklist lastupdate="1479324316851" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist lastupdate="1479474493182" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}">
<prefs/>
@ -13,14 +13,14 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i1231" id="youtube@downloader.yt">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1263" id="axtara__web@axtara.com">
<prefs/>
<versionRange minVersion="0" maxVersion="1.1.1" severity="3"/>
</emItem>
<emItem blockID="i1231" id="youtube@downloader.yt">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i922" id="{34712C68-7391-4c47-94F3-8F88D49AD632}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -48,6 +48,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i522" id="/^({976cd962-e0ca-4337-aea7-d93fae63a79c}|{525ba996-1ce4-4677-91c5-9fc4ead2d245}|{91659dab-9117-42d1-a09f-13ec28037717}|{c1211069-1163-4ba8-b8b3-32fc724766be})$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i1024" id="{458fb825-2370-4973-bf66-9d7142141847}">
<prefs>
<pref>app.update.auto</pref>
@ -57,10 +61,6 @@
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i522" id="/^({976cd962-e0ca-4337-aea7-d93fae63a79c}|{525ba996-1ce4-4677-91c5-9fc4ead2d245}|{91659dab-9117-42d1-a09f-13ec28037717}|{c1211069-1163-4ba8-b8b3-32fc724766be})$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
<prefs/>
<versionRange minVersion=" " maxVersion="8.5"/>
@ -181,11 +181,11 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i716" id="{cc6cc772-f121-49e0-b1f0-c26583cb0c5e}">
<emItem blockID="i501" id="xivars@aol.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i501" id="xivars@aol.com">
<emItem blockID="i716" id="{cc6cc772-f121-49e0-b1f0-c26583cb0c5e}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@ -207,14 +207,14 @@
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i69" id="{977f3b97-5461-4346-92c8-a14c749b77c9}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i444" id="fplayer@adobe.flash">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i69" id="{977f3b97-5461-4346-92c8-a14c749b77c9}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i550" id="colmer@yopmail.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -227,14 +227,14 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i16" id="{27182e60-b5f3-411c-b545-b44205977502}">
<prefs/>
<versionRange minVersion="1.0" maxVersion="1.0"/>
</emItem>
<emItem blockID="i503" id="{9CE11043-9A15-4207-A565-0C94C42D590D}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i16" id="{27182e60-b5f3-411c-b545-b44205977502}">
<prefs/>
<versionRange minVersion="1.0" maxVersion="1.0"/>
</emItem>
<emItem blockID="i549" id="/^firefox@(albrechto|swiftbrowse|springsmart|storimbo|squirrelweb|betterbrowse|lizardlink|rolimno|browsebeyond|clingclang|weblayers|kasimos|higher-aurum|xaven|bomlabio)\.(com?|net|org|info|biz)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
@ -351,8 +351,8 @@
<versionRange minVersion="3.15.22" maxVersion="3.15.22.*" severity="1"/>
<versionRange minVersion="3.15.8" maxVersion="3.15.8.*" severity="1"/>
<versionRange minVersion="3.15.10" maxVersion="3.15.11.*" severity="1"/>
<versionRange minVersion="3.15.18" maxVersion="3.15.20.*" severity="1"/>
<versionRange minVersion="3.15.5" maxVersion="3.15.5.*" severity="1"/>
<versionRange minVersion="3.15.18" maxVersion="3.15.20.*" severity="1"/>
<versionRange minVersion="3.15.31" maxVersion="3.15.31.*" severity="1"/>
<versionRange minVersion="3.15.26" maxVersion="3.15.26.*" severity="1"/>
</emItem>
@ -364,14 +364,14 @@
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i529" id="/^(torntv@torntv\.com|trtv3@trtv\.com|torntv2@torntv\.com|e2fd07a6-e282-4f2e-8965-85565fcb6384@b69158e6-3c3b-476c-9d98-ae5838c5b707\.com)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i784" id="{41e5ef7a-171d-4ab5-8351-951c65a29908}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i529" id="/^(torntv@torntv\.com|trtv3@trtv\.com|torntv2@torntv\.com|e2fd07a6-e282-4f2e-8965-85565fcb6384@b69158e6-3c3b-476c-9d98-ae5838c5b707\.com)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i486" id="xz123@ya456.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -468,10 +468,6 @@
<prefs/>
<versionRange minVersion="39.5.1" maxVersion="47.0.4" severity="3"/>
</emItem>
<emItem blockID="i640" id="jid0-l9BxpNUhx1UUgRfKigWzSfrZqAc@jetpack">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i628" id="ffxtlbr@iminent.com">
<prefs>
<pref>browser.startup.homepage</pref>
@ -479,6 +475,10 @@
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i640" id="jid0-l9BxpNUhx1UUgRfKigWzSfrZqAc@jetpack">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1228" id="unblocker30__web@unblocker.yt">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -529,6 +529,10 @@
<prefs/>
<versionRange minVersion="2.4.6.4" maxVersion="2.4.6.4" severity="1"/>
</emItem>
<emItem blockID="i586" id="jid1-0xtMKhXFEs4jIg@jetpack">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i358" id="lfind@nijadsoft.net">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
@ -545,10 +549,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i586" id="jid1-0xtMKhXFEs4jIg@jetpack">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i786" id="{63eb5ed4-e1b3-47ec-a253-f8462f205350}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -670,11 +670,11 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i538" id="{354dbb0a-71d5-4e9f-9c02-6c88b9d387ba}">
<emItem blockID="i968" id="{184AA5E6-741D-464a-820E-94B3ABC2F3B4}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i968" id="{184AA5E6-741D-464a-820E-94B3ABC2F3B4}">
<emItem blockID="i538" id="{354dbb0a-71d5-4e9f-9c02-6c88b9d387ba}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@ -714,11 +714,11 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1278" id="/^(ff\-)?dodate(kKKK|XkKKK|k|kk|kkx|kR)@(firefox|flash(1)?)\.pl|dode(ee)?k@firefoxnet\.pl|(addon|1)@upsolutions\.pl$/">
<emItem blockID="i256" id="/^[0-9a-f]+@[0-9a-f]+\.info/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i256" id="/^[0-9a-f]+@[0-9a-f]+\.info/">
<emItem blockID="i1278" id="/^(ff\-)?dodate(kKKK|XkKKK|k|kk|kkx|kR)@(firefox|flash(1)?)\.pl|dode(ee)?k@firefoxnet\.pl|(addon|1)@upsolutions\.pl$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@ -762,14 +762,14 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i533" id="extension@Fast_Free_Converter.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i638" id="{7b1bf0b6-a1b9-42b0-b75d-252036438bdc}">
<prefs/>
<versionRange minVersion="27.8" maxVersion="27.9" severity="3"/>
</emItem>
<emItem blockID="i533" id="extension@Fast_Free_Converter.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
<prefs/>
<versionRange minVersion="3.3.1" maxVersion="*">
@ -787,10 +787,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
<prefs/>
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1"/>
</emItem>
<emItem blockID="i686" id="{a7f2cb14-0472-42a1-915a-8adca2280a2c}">
<prefs>
<pref>browser.startup.homepage</pref>
@ -798,6 +794,10 @@
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
<prefs/>
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1"/>
</emItem>
<emItem blockID="i1279" id="dodatek@flash2.pl">
<prefs/>
<versionRange minVersion="1.3" maxVersion="*" severity="3"/>
@ -859,19 +859,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i499" id="{babb9931-ad56-444c-b935-38bffe18ad26}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i718" id="G4Ce4@w.net">
<prefs>
<pref>browser.startup.homepage</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i21" id="support@update-firefox.com">
<prefs/>
</emItem>
<emItem blockID="i75" id="firebug@software.joehewitt.com" os="Darwin,Linux">
<prefs/>
<versionRange minVersion="1.9.0" maxVersion="1.9.0" severity="1">
@ -880,6 +867,19 @@
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i718" id="G4Ce4@w.net">
<prefs>
<pref>browser.startup.homepage</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i499" id="{babb9931-ad56-444c-b935-38bffe18ad26}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i21" id="support@update-firefox.com">
<prefs/>
</emItem>
<emItem blockID="i491" id="{515b2424-5911-40bd-8a2c-bdb20286d8f5}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
@ -892,14 +892,14 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i1264" id="suchpony@suchpony.de">
<prefs/>
<versionRange minVersion="0" maxVersion="1.6.7" severity="3"/>
</emItem>
<emItem blockID="i476" id="mbroctone@facebook.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1264" id="suchpony@suchpony.de">
<prefs/>
<versionRange minVersion="0" maxVersion="1.6.7" severity="3"/>
</emItem>
<emItem blockID="i722" id="{9802047e-5a84-4da3-b103-c55995d147d1}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -941,6 +941,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i664" id="123456789@offeringmedia.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i630" id="webbooster@iminent.com">
<prefs>
<pref>browser.startup.homepage</pref>
@ -948,14 +952,13 @@
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i664" id="123456789@offeringmedia.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i93" id="{68b8676b-99a5-46d1-b390-22411d8bcd61}">
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i7" id="{2224e955-00e9-4613-a844-ce69fccaae91}">
<prefs/>
</emItem>
<emItem blockID="i624" id="/^({b95faac1-a3d7-4d69-8943-ddd5a487d966}|{ecce0073-a837-45a2-95b9-600420505f7e}|{2713b394-286f-4d7c-89ea-4174eeab9f5a}|{da7a20cf-bef4-4342-ad78-0240fdf87055})$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
@ -964,9 +967,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i7" id="{2224e955-00e9-4613-a844-ce69fccaae91}">
<prefs/>
</emItem>
<emItem blockID="i842" id="{746505DC-0E21-4667-97F8-72EA6BCF5EEF}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
@ -1021,11 +1021,11 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i816" id="noOpus@outlook.com">
<emItem blockID="i485" id="/^brasilescape.*\@facebook\.com$//">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i485" id="/^brasilescape.*\@facebook\.com$//">
<emItem blockID="i816" id="noOpus@outlook.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@ -1164,13 +1164,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i844" id="e9d197d59f2f45f382b1aa5c14d82@8706aaed9b904554b5cb7984e9.com">
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i216" id="fdm_ffext@freedownloadmanager.org">
<prefs/>
<versionRange minVersion="1.0" maxVersion="1.3.1">
@ -1180,14 +1173,21 @@
</versionRange>
<versionRange minVersion="1.5.7.5" maxVersion="1.5.7.5" severity="1"/>
</emItem>
<emItem blockID="i596" id="{b99c8534-7800-48fa-bd71-519a46cdc7e1}">
<prefs/>
<emItem blockID="i844" id="e9d197d59f2f45f382b1aa5c14d82@8706aaed9b904554b5cb7984e9.com">
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i461" id="{8E9E3331-D360-4f87-8803-52DE43566502}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i596" id="{b99c8534-7800-48fa-bd71-519a46cdc7e1}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i818" id="contentarget@maildrop.cc">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -1313,6 +1313,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i452" id="{77beece6-3997-403a-92fa-0055bfcf88e5}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i858" id="fftoolbar2014@etech.com">
<prefs>
<pref>browser.startup.homepage</pref>
@ -1320,10 +1324,6 @@
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i452" id="{77beece6-3997-403a-92fa-0055bfcf88e5}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i1018" id="grjkntbhr@hgergerherg.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -1392,11 +1392,11 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i780" id="{b6ef1336-69bb-45b6-8cba-e578fc0e4433}">
<emItem blockID="i469" id="OKitSpace@OKitSpace.es">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i469" id="OKitSpace@OKitSpace.es">
<emItem blockID="i780" id="{b6ef1336-69bb-45b6-8cba-e578fc0e4433}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@ -1470,14 +1470,14 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i588" id="quick_start@gmail.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i40" id="{28387537-e3f9-4ed7-860c-11e69af4a8a0}">
<prefs/>
<versionRange minVersion="0.1" maxVersion="4.3.1.00" severity="1"/>
</emItem>
<emItem blockID="i588" id="quick_start@gmail.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i426" id="addlyrics@addlyrics.net">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
@ -1592,14 +1592,14 @@
<prefs/>
<versionRange minVersion=" " severity="1"/>
</emItem>
<emItem blockID="i73" id="a1g0a9g219d@a1.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i854" id="/^(7tG@zEb\.net|ru@gfK0J\.edu)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i73" id="a1g0a9g219d@a1.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i662" id="imbaty@taringamp3.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -1643,10 +1643,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i672" id="/^(saamazon@mybrowserbar\.com)|(saebay@mybrowserbar\.com)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i864" id="{0A92F062-6AC6-8180-5881-B6E0C0DC2CC5}">
<prefs>
<pref>browser.startup.homepage</pref>
@ -1654,6 +1650,10 @@
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i672" id="/^(saamazon@mybrowserbar\.com)|(saebay@mybrowserbar\.com)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i634" id="jid1-4vUehhSALFNqCw@jetpack">
<prefs/>
<versionRange minVersion="99.7" maxVersion="99.7" severity="3"/>
@ -1687,11 +1687,11 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i836" id="hansin@topvest.id">
<emItem blockID="i495" id="kallow@facebook.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i495" id="kallow@facebook.com">
<emItem blockID="i836" id="hansin@topvest.id">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@ -1801,10 +1801,6 @@
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i382" id="{6926c7f7-6006-42d1-b046-eba1b3010315}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i806" id="{d9284e50-81fc-11da-a72b-0800200c9a66}">
<prefs/>
<versionRange minVersion="0" maxVersion="7.7.34" severity="1">
@ -1817,6 +1813,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i382" id="{6926c7f7-6006-42d1-b046-eba1b3010315}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i812" id="{1e4ea5fc-09e5-4f45-a43b-c048304899fc}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -1841,11 +1841,11 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i578" id="jid1-XLjasWL55iEE1Q@jetpack">
<emItem blockID="i1213" id="unblocker20__web@unblocker.yt">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1213" id="unblocker20__web@unblocker.yt">
<emItem blockID="i578" id="jid1-XLjasWL55iEE1Q@jetpack">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@ -1893,10 +1893,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i808" id="{c96d1ae6-c4cf-4984-b110-f5f561b33b5a}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1214" id="firefoxdav@icloud.com">
<prefs/>
<versionRange minVersion="0" maxVersion="1.4.22" severity="1"/>
@ -1905,6 +1901,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i808" id="{c96d1ae6-c4cf-4984-b110-f5f561b33b5a}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i4" id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
<prefs/>
<versionRange minVersion="1.2" maxVersion="1.2">
@ -3427,9 +3427,6 @@
</gfxBlacklistEntry>
</gfxItems>
<certItems>
<certItem issuerName="MG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3Q=">
<serialNumber>Os2rnHWYhryvdOXfgan06A==</serialNumber>
</certItem>
<certItem issuerName="MH4xCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEvMC0GA1UEAxMmU3ltYW50ZWMgQ2xhc3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzQ=">
<serialNumber>d8AtKymQwkOPDBj+hjPzFg==</serialNumber>
</certItem>
@ -3709,9 +3706,6 @@
<certItem issuerName="MFoxCzAJBgNVBAYTAkRFMRMwEQYDVQQKEwpERk4tVmVyZWluMRAwDgYDVQQLEwdERk4tUEtJMSQwIgYDVQQDExtERk4tVmVyZWluIFBDQSBHbG9iYWwgLSBHMDE=">
<serialNumber>Cfk9lw==</serialNumber>
</certItem>
<certItem issuerName="MG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3Q=">
<serialNumber>U3t2Vk8pfxTcaUPpIq0seQ==</serialNumber>
</certItem>
<certItem issuerName="MIGQMQswCQYDVQQGEwJHUjFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxOzA5BgNVBAMTMkFyaXN0b3RsZSBVbml2ZXJzaXR5IG9mIFRoZXNzYWxvbmlraSBDZW50cmFsIENBIFI0">
<serialNumber>EqthLKdUgwI=</serialNumber>
</certItem>
@ -3724,9 +3718,6 @@
<certItem issuerName="MHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWU=">
<serialNumber>M64Z5ufZzDRVTHkJR1uXzw==</serialNumber>
</certItem>
<certItem issuerName="MG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3Q=">
<serialNumber>RurwlgVMxeP6Zepun0LGZA==</serialNumber>
</certItem>
<certItem issuerName="MHExKDAmBgNVBAMTH0dsb2JhbFNpZ24gUm9vdFNpZ24gUGFydG5lcnMgQ0ExHTAbBgNVBAsTFFJvb3RTaWduIFBhcnRuZXJzIENBMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMQswCQYDVQQGEwJCRQ==">
<serialNumber>BAAAAAABGMGjftY=</serialNumber>
</certItem>

Просмотреть файл

@ -95,10 +95,6 @@ panelview:not([mainview]):not([current]) {
visibility: collapse;
}
browser[frameType="social"][remote="true"] {
-moz-binding: url("chrome://global/content/bindings/remote-browser.xml#remote-browser");
}
tabbrowser {
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser");
}

Просмотреть файл

@ -4827,6 +4827,8 @@
"-moz-default-background-color" :
Services.prefs.getCharPref("browser.display.background_color");
let messageManager = window.getGroupMessageManager("browsers");
let remote = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext)
@ -4834,7 +4836,7 @@
if (remote) {
messageManager.addMessageListener("DOMTitleChanged", this);
messageManager.addMessageListener("DOMWindowClose", this);
messageManager.addMessageListener("contextmenu", this);
window.messageManager.addMessageListener("contextmenu", this);
messageManager.addMessageListener("Browser:Init", this);
// If this window has remote tabs, switch to our tabpanels fork
@ -4907,8 +4909,9 @@
window.removeEventListener("sizemodechange", this, false);
if (gMultiProcessBrowser) {
let messageManager = window.getGroupMessageManager("browsers");
messageManager.removeMessageListener("DOMTitleChanged", this);
messageManager.removeMessageListener("contextmenu", this);
window.messageManager.removeMessageListener("contextmenu", this);
if (this._switcher) {
this._switcher.destroy();

Просмотреть файл

@ -480,11 +480,9 @@ function* test_delayed_tabattr_removal() {
}
add_task(function*() {
yield new Promise((resolve) => {
SpecialPowers.pushPrefEnv({"set": [
["browser.tabs.showAudioPlayingIcon", true],
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["browser.tabs.showAudioPlayingIcon", true],
]});
});
requestLongerTimeout(2);

Просмотреть файл

@ -99,9 +99,9 @@ function waitForSomeTabToLoad() {
* Ensure the Mixed Content Blocker is enabled.
*/
add_task(function* test_initialize() {
yield new Promise(resolve => SpecialPowers.pushPrefEnv({
yield SpecialPowers.pushPrefEnv({
"set": [["security.mixed_content.block_active_content", true]],
}, resolve));
});
});
/**

Просмотреть файл

@ -17,9 +17,9 @@ function waitForInsecureLoginFormsStateChange(browser, count) {
* Checks the insecure login forms logic for the identity block.
*/
add_task(function* test_simple() {
yield new Promise(resolve => SpecialPowers.pushPrefEnv({
yield SpecialPowers.pushPrefEnv({
"set": [["security.insecure_password.ui.enabled", true]],
}, resolve));
});
for (let [origin, expectWarning] of [
["http://example.com", true],
@ -82,9 +82,9 @@ add_task(function* test_simple() {
* blocking messages when mixed active content is loaded.
*/
add_task(function* test_mixedcontent() {
yield new Promise(resolve => SpecialPowers.pushPrefEnv({
yield SpecialPowers.pushPrefEnv({
"set": [["security.mixed_content.block_active_content", false]],
}, resolve));
});
// Load the page with the subframe in a new tab.
let testUrlPath = "://example.com" + TEST_URL_PATH;

Просмотреть файл

@ -15,14 +15,12 @@ const gHttpTestUrl = "http://example.com/browser/browser/base/content/test/gener
var gTestBrowser = null;
add_task(function *() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({
"set": [
["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]
]
}, resolve);
});
yield SpecialPowers.pushPrefEnv({
"set": [
["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]
]});
let url = gHttpTestUrl
yield BrowserTestUtils.withNewTab({gBrowser, url}, function*() {
gTestBrowser = gBrowser.selectedBrowser;

Просмотреть файл

@ -17,13 +17,11 @@ var gTestBrowser = null;
add_task(function *() {
let url = gHttpTestRoot1 + "file_mixedContentFromOnunload.html";
yield BrowserTestUtils.withNewTab({gBrowser, url}, function*() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({
"set": [
["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]
]
}, resolve);
yield SpecialPowers.pushPrefEnv({
"set": [
["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]
]
});
gTestBrowser = gBrowser.selectedBrowser;
// Navigation from an http page to a https page with no mixed content

Просмотреть файл

@ -18,10 +18,7 @@ function waitForSecurityChange(numChanges = 1) {
}
add_task(function* test_fetch() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({ set: [['privacy.trackingprotection.enabled', true]] },
resolve);
});
yield SpecialPowers.pushPrefEnv({ set: [['privacy.trackingprotection.enabled', true]] });
yield BrowserTestUtils.withNewTab({ gBrowser, url: URL }, function* (newTabBrowser) {
let securityChange = waitForSecurityChange();

Просмотреть файл

@ -23,11 +23,9 @@ var with_new_tab_opened = Task.async(function* (options, taskFn) {
});
add_task(function*() {
yield new Promise((resolve) => {
SpecialPowers.pushPrefEnv({"set": [
["view_source.tab", true],
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["view_source.tab", true],
]});
});
add_task(function* test_regular_page() {

Просмотреть файл

@ -91,8 +91,7 @@ registerCleanupFunction(function() {
});
function pushPrefs(...aPrefs) {
return new Promise(resolve =>
SpecialPowers.pushPrefEnv({"set": aPrefs}, resolve));
return SpecialPowers.pushPrefEnv({"set": aPrefs});
}
/**

Просмотреть файл

@ -28,7 +28,7 @@ add_task(function* () {
*/
add_task(function* () {
let input = "To be or not to be-that is the question";
yield new Promise(resolve => SpecialPowers.pushPrefEnv({set: [["keyword.enabled", false]]}, resolve));
yield SpecialPowers.pushPrefEnv({set: [["keyword.enabled", false]]});
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:newtab", false);
// NB: CPOW usage because new tab pages can be preloaded, in which case no
// load events fire.

Просмотреть файл

@ -5,7 +5,7 @@
* "example" and hit enter, the browser loads and the URL bar is updated accordingly.
*/
add_task(function* () {
yield new Promise(resolve => SpecialPowers.pushPrefEnv({set: [["keyword.enabled", false]]}, resolve));
yield SpecialPowers.pushPrefEnv({set: [["keyword.enabled", false]]});
yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (browser) {
gURLBar.value = "example";
gURLBar.select();

Просмотреть файл

@ -6,14 +6,11 @@ const BASE_URI = "http://mochi.test:8888/browser/browser/components/"
+ "contextualidentity/test/browser/empty_file.html";
add_task(function* setup() {
yield new Promise((resolve) => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]});
});
add_task(function* test() {
info("Creating a tab with UCI = 1...");
let tab1 = gBrowser.addTab(BASE_URI, {userContextId: 1});

Просмотреть файл

@ -21,11 +21,9 @@ function* openTabInUserContext(uri, userContextId) {
add_task(function* setup() {
// make sure userContext is enabled.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]});
});
add_task(function* test() {

Просмотреть файл

@ -85,15 +85,13 @@ function generateKeyInfo(aData) {
add_task(function* setup() {
// Make sure userContext is enabled.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
[ "privacy.userContext.enabled", true ],
[ "media.mediasource.enabled", true ],
[ "media.eme.apiVisible", true ],
[ "media.mediasource.webm.enabled", true ],
[ "media.clearkey.persistent-license.enabled", true ],
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
[ "privacy.userContext.enabled", true ],
[ "media.mediasource.enabled", true ],
[ "media.eme.apiVisible", true ],
[ "media.mediasource.webm.enabled", true ],
[ "media.clearkey.persistent-license.enabled", true ],
]});
});
add_task(function* test() {

Просмотреть файл

@ -77,11 +77,9 @@ function loadFaviconHandler(metadata, response) {
add_task(function* setup() {
// Make sure userContext is enabled.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]});
// Create a http server for the image cache test.
if (!gHttpServer) {

Просмотреть файл

@ -318,11 +318,9 @@ function* test_storage_cleared() {
add_task(function* setup() {
// Make sure userContext is enabled.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]});
// Create a http server for the image cache test.
if (!gHttpServer) {

Просмотреть файл

@ -23,12 +23,10 @@ function openTabInUserContext(uri, userContextId) {
add_task(function* setup() {
// make sure userContext is enabled.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["dom.ipc.processCount", 1]
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["dom.ipc.processCount", 1]
]});
});
let infos = [];

Просмотреть файл

@ -27,12 +27,10 @@ function openTabInUserContext(uri, userContextId) {
add_task(function* setup() {
// make sure userContext is enabled.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["dom.ipc.processCount", 1]
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["dom.ipc.processCount", 1]
]});
});
add_task(function* test() {

Просмотреть файл

@ -13,12 +13,10 @@ const BASE_URI = "http://mochi.test:8888/browser/browser/components/"
add_task(function* setup() {
// make sure userContext is enabled.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["browser.link.open_newwindow", 3],
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["browser.link.open_newwindow", 3],
]});
});
add_task(function* test() {

Просмотреть файл

@ -7,12 +7,10 @@ const BASE_URI = "http://mochi.test:8888/browser/browser/components/"
+ "contextualidentity/test/browser/empty_file.html";
add_task(function* setup() {
yield new Promise((resolve) => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["browser.link.open_newwindow", 2],
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["browser.link.open_newwindow", 2],
]});
});

Просмотреть файл

@ -1456,15 +1456,12 @@ var CustomizableUIInternal = {
return def;
},
addShortcut: function(aShortcutNode, aTargetNode) {
if (!aTargetNode)
aTargetNode = aShortcutNode;
let document = aShortcutNode.ownerDocument;
addShortcut: function(aShortcutNode, aTargetNode = aShortcutNode) {
// Detect if we've already been here before.
if (!aTargetNode || aTargetNode.hasAttribute("shortcut"))
if (aTargetNode.hasAttribute("shortcut"))
return;
let document = aShortcutNode.ownerDocument;
let shortcutId = aShortcutNode.getAttribute("key");
let shortcut;
if (shortcutId) {

Просмотреть файл

@ -208,12 +208,10 @@ function* setDownloadDir() {
});
}
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["browser.download.folderList", 2],
["browser.download.dir", tmpDir, Ci.nsIFile],
]}, resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
["browser.download.folderList", 2],
["browser.download.dir", tmpDir, Ci.nsIFile],
]});
}

Просмотреть файл

@ -8,6 +8,7 @@ module.exports = { // eslint-disable-line no-undef
"browserActionFor": true,
"currentWindow": true,
"EventEmitter": true,
"getBrowserInfo": true,
"getCookieStoreIdForTab": true,
"IconDetails": true,
"makeWidgetId": true,

Просмотреть файл

@ -25,29 +25,21 @@ var {
// This function is pretty tightly tied to Extension.jsm.
// Its job is to fill in the |tab| property of the sender.
function getSender(extension, target, sender) {
let tabId;
if ("tabId" in sender) {
// The message came from an ExtensionContext. In that case, it should
// include a tabId property (which is filled in by the page-open
// listener below).
let tab = TabManager.getTab(sender.tabId, null, null);
// The message came from a privileged extension page running in a tab. In
// that case, it should include a tabId property (which is filled in by the
// page-open listener below).
tabId = sender.tabId;
delete sender.tabId;
} else if (target instanceof Ci.nsIDOMXULElement) {
tabId = getBrowserInfo(target).tabId;
}
if (tabId) {
let tab = TabManager.getTab(tabId, null, null);
if (tab) {
sender.tab = TabManager.convert(extension, tab);
return;
}
}
if (target instanceof Ci.nsIDOMXULElement) {
// If the message was sent from a content script to a <browser> element,
// then we can just get the `tab` from `target`.
let tabbrowser = target.ownerGlobal.gBrowser;
if (tabbrowser) {
let tab = tabbrowser.getTabForBrowser(target);
// `tab` can be `undefined`, e.g. for extension popups. This condition is
// reached if `getSender` is called for a popup without a valid `tabId`.
if (tab) {
sender.tab = TabManager.convert(extension, tab);
}
}
}
}
@ -76,10 +68,13 @@ extensions.on("page-shutdown", (type, context) => {
});
extensions.on("fill-browser-data", (type, browser, data) => {
let gBrowser = browser && browser.ownerGlobal.gBrowser;
let tab = gBrowser && gBrowser.getTabForBrowser(browser);
data.tabId = tab ? TabManager.getId(tab) : -1;
data.windowId = tab ? WindowManager.getId(tab.ownerGlobal) : -1;
let tabId, windowId;
if (browser) {
({tabId, windowId} = getBrowserInfo(browser));
}
data.tabId = tabId || -1;
data.windowId = windowId || -1;
});
/* eslint-enable mozilla/balanced-listeners */

Просмотреть файл

@ -123,11 +123,13 @@ class BasePopup {
this.destroyed = true;
this.browserLoadedDeferred.reject(new Error("Popup destroyed"));
return this.browserReady.then(() => {
this.destroyBrowser(this.browser);
this.destroyBrowser(this.browser, true);
this.browser.remove();
this.viewNode.removeEventListener(this.DESTROY_EVENT, this);
this.viewNode.style.maxHeight = "";
if (this.viewNode) {
this.viewNode.removeEventListener(this.DESTROY_EVENT, this);
this.viewNode.style.maxHeight = "";
}
if (this.panel) {
this.panel.style.removeProperty("--arrowpanel-background");
@ -141,16 +143,19 @@ class BasePopup {
});
}
destroyBrowser(browser) {
destroyBrowser(browser, finalize = false) {
let mm = browser.messageManager;
// If the browser has already been removed from the document, because the
// popup was closed externally, there will be no message manager here.
// popup was closed externally, there will be no message manager here, so
// just replace our receiveMessage method with a stub.
if (mm) {
mm.removeMessageListener("DOMTitleChanged", this);
mm.removeMessageListener("Extension:BrowserBackgroundChanged", this);
mm.removeMessageListener("Extension:BrowserContentLoaded", this);
mm.removeMessageListener("Extension:BrowserResized", this);
mm.removeMessageListener("Extension:DOMWindowClose", this);
} else if (finalize) {
this.receiveMessage = () => {};
}
}
@ -213,60 +218,73 @@ class BasePopup {
handleEvent(event) {
switch (event.type) {
case this.DESTROY_EVENT:
this.destroy();
if (!this.destroyed) {
this.destroy();
}
break;
}
}
createBrowser(viewNode, popupURL = null) {
let document = viewNode.ownerDocument;
this.browser = document.createElementNS(XUL_NS, "browser");
this.browser.setAttribute("type", "content");
this.browser.setAttribute("disableglobalhistory", "true");
this.browser.setAttribute("transparent", "true");
this.browser.setAttribute("class", "webextension-popup-browser");
this.browser.setAttribute("tooltip", "aHTMLTooltip");
let browser = document.createElementNS(XUL_NS, "browser");
browser.setAttribute("type", "content");
browser.setAttribute("disableglobalhistory", "true");
browser.setAttribute("transparent", "true");
browser.setAttribute("class", "webextension-popup-browser");
browser.setAttribute("webextension-view-type", "popup");
browser.setAttribute("tooltip", "aHTMLTooltip");
if (this.extension.remote) {
browser.setAttribute("remote", "true");
}
// We only need flex sizing for the sake of the slide-in sub-views of the
// main menu panel, so that the browser occupies the full width of the view,
// and also takes up any extra height that's available to it.
this.browser.setAttribute("flex", "1");
browser.setAttribute("flex", "1");
// Note: When using noautohide panels, the popup manager will add width and
// height attributes to the panel, breaking our resize code, if the browser
// starts out smaller than 30px by 10px. This isn't an issue now, but it
// will be if and when we popup debugging.
viewNode.appendChild(this.browser);
this.browser = browser;
extensions.emit("extension-browser-inserted", this.browser);
let windowId = WindowManager.getId(this.browser.ownerGlobal);
this.browser.messageManager.sendAsyncMessage("Extension:InitExtensionView", {
viewType: "popup",
windowId,
});
// TODO(robwu): Rework this to use the Extension:ExtensionViewLoaded message
// to detect loads and so on. And definitely move this content logic inside
// a file in the child process.
let readyPromise;
if (this.extension.remote) {
readyPromise = promiseEvent(browser, "XULFrameLoaderCreated");
} else {
readyPromise = promiseEvent(browser, "load");
}
let initBrowser = browser => {
viewNode.appendChild(browser);
extensions.emit("extension-browser-inserted", browser);
let setupBrowser = browser => {
let mm = browser.messageManager;
mm.addMessageListener("DOMTitleChanged", this);
mm.addMessageListener("Extension:BrowserBackgroundChanged", this);
mm.addMessageListener("Extension:BrowserContentLoaded", this);
mm.addMessageListener("Extension:BrowserResized", this);
mm.addMessageListener("Extension:DOMWindowClose", this, true);
return browser;
};
if (!popupURL) {
initBrowser(this.browser);
return this.browser;
// For remote browsers, we can't do any setup until the frame loader is
// created. Non-remote browsers get a message manager immediately, so
// there's no need to wait for the load event.
if (this.extension.remote) {
return readyPromise.then(() => setupBrowser(browser));
}
return setupBrowser(browser);
}
return promiseEvent(this.browser, "load").then(() => {
initBrowser(this.browser);
let mm = this.browser.messageManager;
return readyPromise.then(() => {
setupBrowser(browser);
let mm = browser.messageManager;
mm.loadFrameScript(
"chrome://extensions/content/ext-browser-content.js", false);
@ -279,7 +297,7 @@ class BasePopup {
stylesheets: this.STYLESHEETS,
});
this.browser.setAttribute("src", popupURL);
browser.loadURI(popupURL);
});
}
@ -370,12 +388,13 @@ class PanelPopup extends BasePopup {
destroy() {
super.destroy();
this.viewNode.remove();
this.viewNode = null;
}
closePopup() {
promisePopupShown(this.viewNode).then(() => {
// Make sure we're not already destroyed.
if (this.viewNode) {
// Make sure we're not already destroyed, or removed from the DOM.
if (this.viewNode && this.viewNode.hidePopup) {
this.viewNode.hidePopup();
}
});
@ -398,6 +417,7 @@ class ViewPopup extends BasePopup {
this.ignoreResizes = true;
this.attached = false;
this.shown = false;
this.tempPanel = panel;
this.browser.classList.add("webextension-preload-browser");
@ -439,11 +459,13 @@ class ViewPopup extends BasePopup {
}
if (this.destroyed) {
CustomizableUI.hidePanelForNode(viewNode);
return false;
}
this.attached = true;
// Store the initial height of the view, so that we never resize menu panel
// sub-views smaller than the initial height of the menu.
this.viewHeight = this.viewNode.boxObject.height;
@ -464,7 +486,7 @@ class ViewPopup extends BasePopup {
// Create a new browser in the real popup.
let browser = this.browser;
this.createBrowser(this.viewNode);
yield this.createBrowser(this.viewNode);
this.browser.swapDocShells(browser);
this.destroyBrowser(browser);
@ -477,6 +499,14 @@ class ViewPopup extends BasePopup {
this.tempPanel.remove();
this.tempPanel = null;
this.shown = true;
if (this.destroyed) {
this.closePopup();
this.destroy();
return false;
}
let event = new this.window.CustomEvent("WebExtPopupLoaded", {
bubbles: true,
detail: {extension: this.extension},
@ -501,8 +531,10 @@ class ViewPopup extends BasePopup {
}
closePopup() {
if (this.attached) {
if (this.shown) {
CustomizableUI.hidePanelForNode(this.viewNode);
} else if (this.attached) {
this.destroyed = true;
} else {
this.destroy();
}
@ -689,21 +721,46 @@ ExtensionTabManager.prototype = {
},
};
function getBrowserInfo(browser) {
if (!browser.ownerGlobal.gBrowser) {
// When we're loaded into a <browser> inside about:addons, we need to go up
// one more level.
browser = browser.ownerGlobal.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.chromeEventHandler;
if (!browser) {
return {};
}
}
let result = {};
let window = browser.ownerGlobal;
if (window.gBrowser) {
let tab = window.gBrowser.getTabForBrowser(browser);
if (tab) {
result.tabId = TabManager.getId(tab);
}
result.windowId = WindowManager.getId(window);
}
return result;
}
global.getBrowserInfo = getBrowserInfo;
// Sends the tab and windowId upon request. This is primarily used to support
// the synchronous `browser.extension.getViews` API.
let onGetTabAndWindowId = {
receiveMessage({name, target, sync}) {
let {gBrowser} = target.ownerGlobal;
let tab = gBrowser && gBrowser.getTabForBrowser(target);
if (tab) {
let reply = {
tabId: TabManager.getId(tab),
windowId: WindowManager.getId(tab.ownerGlobal),
};
let result = getBrowserInfo(target);
if (result.tabId) {
if (sync) {
return reply;
return result;
}
target.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", reply);
target.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", result);
}
},
};

Просмотреть файл

@ -12,6 +12,10 @@ EXTRA_COMPONENTS += [
DIRS += ['schemas']
BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
BROWSER_CHROME_MANIFESTS += [
'test/browser/browser-remote.ini',
'test/browser/browser.ini',
]
MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']

Просмотреть файл

@ -0,0 +1,105 @@
[DEFAULT]
support-files =
head.js
head_pageAction.js
head_sessions.js
context.html
ctxmenu-image.png
context_tabs_onUpdated_page.html
context_tabs_onUpdated_iframe.html
file_popup_api_injection_a.html
file_popup_api_injection_b.html
file_iframe_document.html
file_iframe_document.sjs
file_bypass_cache.sjs
file_language_fr_en.html
file_language_ja.html
file_language_tlh.html
file_dummy.html
searchSuggestionEngine.xml
searchSuggestionEngine.sjs
[browser_ext_browserAction_context.js]
[browser_ext_browserAction_disabled.js]
[browser_ext_browserAction_pageAction_icon.js]
[browser_ext_browserAction_pageAction_icon_permissions.js]
[browser_ext_browserAction_popup.js]
[browser_ext_browserAction_popup_preload.js]
[browser_ext_browserAction_popup_resize.js]
[browser_ext_browserAction_simple.js]
[browser_ext_commands_execute_browser_action.js]
[browser_ext_commands_execute_page_action.js]
[browser_ext_commands_getAll.js]
[browser_ext_commands_onCommand.js]
[browser_ext_contentscript_connect.js]
[browser_ext_contextMenus.js]
[browser_ext_contextMenus_checkboxes.js]
[browser_ext_contextMenus_icons.js]
[browser_ext_contextMenus_onclick.js]
[browser_ext_contextMenus_radioGroups.js]
[browser_ext_contextMenus_uninstall.js]
[browser_ext_contextMenus_urlPatterns.js]
[browser_ext_currentWindow.js]
[browser_ext_getViews.js]
[browser_ext_incognito_popup.js]
[browser_ext_lastError.js]
[browser_ext_optionsPage_privileges.js]
[browser_ext_pageAction_context.js]
[browser_ext_pageAction_popup.js]
[browser_ext_pageAction_popup_resize.js]
[browser_ext_pageAction_simple.js]
[browser_ext_pageAction_title.js]
[browser_ext_popup_api_injection.js]
[browser_ext_popup_background.js]
[browser_ext_popup_corners.js]
[browser_ext_popup_sendMessage.js]
[browser_ext_popup_shutdown.js]
[browser_ext_runtime_openOptionsPage.js]
[browser_ext_runtime_openOptionsPage_uninstall.js]
[browser_ext_runtime_setUninstallURL.js]
[browser_ext_sessions_getRecentlyClosed.js]
[browser_ext_sessions_getRecentlyClosed_private.js]
[browser_ext_sessions_restore.js]
[browser_ext_simple.js]
[browser_ext_tab_runtimeConnect.js]
[browser_ext_tabs_audio.js]
[browser_ext_tabs_captureVisibleTab.js]
[browser_ext_tabs_create.js]
[browser_ext_tabs_create_invalid_url.js]
[browser_ext_tabs_detectLanguage.js]
[browser_ext_tabs_duplicate.js]
[browser_ext_tabs_events.js]
[browser_ext_tabs_executeScript.js]
[browser_ext_tabs_executeScript_good.js]
[browser_ext_tabs_executeScript_bad.js]
[browser_ext_tabs_executeScript_runAt.js]
[browser_ext_tabs_getCurrent.js]
[browser_ext_tabs_insertCSS.js]
[browser_ext_tabs_removeCSS.js]
[browser_ext_tabs_move.js]
[browser_ext_tabs_move_window.js]
[browser_ext_tabs_move_window_multiple.js]
[browser_ext_tabs_move_window_pinned.js]
[browser_ext_tabs_onHighlighted.js]
[browser_ext_tabs_onUpdated.js]
[browser_ext_tabs_query.js]
[browser_ext_tabs_reload.js]
[browser_ext_tabs_reload_bypass_cache.js]
[browser_ext_tabs_sendMessage.js]
[browser_ext_tabs_cookieStoreId.js]
[browser_ext_tabs_update.js]
[browser_ext_tabs_zoom.js]
[browser_ext_tabs_update_url.js]
[browser_ext_topwindowid.js]
[browser_ext_webNavigation_frameId0.js]
[browser_ext_webNavigation_getFrames.js]
[browser_ext_windows.js]
[browser_ext_windows_create.js]
tags = fullscreen
[browser_ext_windows_create_params.js]
[browser_ext_windows_create_tabId.js]
[browser_ext_windows_create_url.js]
[browser_ext_windows_size.js]
skip-if = os == 'mac' # Fails when windows are randomly opened in fullscreen mode
[browser_ext_windows_update.js]
tags = fullscreen

Просмотреть файл

@ -0,0 +1,12 @@
[DEFAULT]
# This is a horrible hack:
# In order to run tests under two configurations, we create two browser test
# manifests, and include a manifest with a common set of tests from each. In
# order to detect which manifest we're running from, we install the tests listed
# in this manifest to the sub-directory "test-oop-extensions", and then check
# whether we're running from that directory from head.js
install-to-subdir = test-oop-extensions
tags = webextensions remote-webextensions
skip-if = !e10s
[include:browser-common.ini]

Просмотреть файл

@ -1,111 +1,12 @@
[DEFAULT]
support-files =
head.js
head_pageAction.js
head_sessions.js
context.html
ctxmenu-image.png
context_tabs_onUpdated_page.html
context_tabs_onUpdated_iframe.html
file_popup_api_injection_a.html
file_popup_api_injection_b.html
file_iframe_document.html
file_iframe_document.sjs
file_bypass_cache.sjs
file_language_fr_en.html
file_language_ja.html
file_language_tlh.html
file_dummy.html
searchSuggestionEngine.xml
searchSuggestionEngine.sjs
tags = webextensions
tags = webextensions in-process-webextensions
[browser_ext_browserAction_context.js]
[browser_ext_browserAction_disabled.js]
[browser_ext_browserAction_pageAction_icon.js]
[browser_ext_browserAction_pageAction_icon_permissions.js]
[browser_ext_browserAction_popup.js]
[browser_ext_browserAction_popup_resize.js]
[browser_ext_browserAction_simple.js]
[browser_ext_commands_execute_browser_action.js]
[browser_ext_commands_execute_page_action.js]
[browser_ext_commands_getAll.js]
[browser_ext_commands_onCommand.js]
[browser_ext_contentscript_connect.js]
[browser_ext_contextMenus.js]
[browser_ext_contextMenus_checkboxes.js]
[browser_ext_contextMenus_icons.js]
[browser_ext_contextMenus_onclick.js]
[browser_ext_contextMenus_radioGroups.js]
[browser_ext_contextMenus_uninstall.js]
[browser_ext_contextMenus_urlPatterns.js]
[browser_ext_currentWindow.js]
[browser_ext_getViews.js]
[browser_ext_incognito_popup.js]
[browser_ext_lastError.js]
[browser_ext_legacy_extension_context_contentscript.js]
[browser_ext_omnibox.js]
[browser_ext_optionsPage_privileges.js]
[browser_ext_pageAction_context.js]
[browser_ext_pageAction_popup.js]
[browser_ext_pageAction_popup_resize.js]
[browser_ext_pageAction_simple.js]
[browser_ext_pageAction_title.js]
[browser_ext_popup_api_injection.js]
[browser_ext_popup_background.js]
[browser_ext_popup_corners.js]
[browser_ext_popup_sendMessage.js]
[browser_ext_popup_shutdown.js]
[browser_ext_runtime_openOptionsPage.js]
[browser_ext_runtime_openOptionsPage_uninstall.js]
[browser_ext_runtime_setUninstallURL.js]
[browser_ext_sessions_getRecentlyClosed.js]
[browser_ext_sessions_getRecentlyClosed_private.js]
[browser_ext_sessions_restore.js]
[browser_ext_simple.js]
[browser_ext_tab_runtimeConnect.js]
[browser_ext_tabs_audio.js]
[browser_ext_tabs_captureVisibleTab.js]
[browser_ext_tabs_create.js]
[browser_ext_tabs_create_invalid_url.js]
[browser_ext_tabs_detectLanguage.js]
[browser_ext_tabs_duplicate.js]
[browser_ext_tabs_events.js]
[browser_ext_tabs_executeScript.js]
[browser_ext_tabs_executeScript_good.js]
[browser_ext_tabs_executeScript_bad.js]
[browser_ext_tabs_executeScript_runAt.js]
[browser_ext_tabs_getCurrent.js]
[browser_ext_tabs_insertCSS.js]
[browser_ext_tabs_removeCSS.js]
[browser_ext_tabs_move.js]
[browser_ext_tabs_move_window.js]
[browser_ext_tabs_move_window_multiple.js]
[browser_ext_tabs_move_window_pinned.js]
[browser_ext_tabs_onHighlighted.js]
[browser_ext_tabs_onUpdated.js]
[browser_ext_tabs_query.js]
[browser_ext_tabs_reload.js]
[browser_ext_tabs_reload_bypass_cache.js]
[browser_ext_tabs_sendMessage.js]
[browser_ext_tabs_cookieStoreId.js]
[browser_ext_tabs_update.js]
[browser_ext_tabs_zoom.js]
[browser_ext_tabs_update_url.js]
[browser_ext_topwindowid.js]
[browser_ext_webNavigation_frameId0.js]
[browser_ext_webNavigation_getFrames.js]
[browser_ext_webNavigation_urlbar_transitions.js]
[browser_ext_windows.js]
[browser_ext_windows_allowScriptsToClose.js]
[browser_ext_windows_create.js]
tags = fullscreen
[browser_ext_windows_create_params.js]
[browser_ext_windows_create_tabId.js]
[browser_ext_windows_create_url.js]
[browser_ext_windows_events.js]
[browser_ext_windows_size.js]
skip-if = os == 'mac' # Fails when windows are randomly opened in fullscreen mode
[browser_ext_windows_update.js]
tags = fullscreen
[include:browser-common.ini]
[parent:browser-common.ini]

Просмотреть файл

@ -82,7 +82,7 @@ function* testInArea(area) {
() => {
browser.test.log(`Set popup to "c" and click browser action. Expect popup "c".`);
browser.browserAction.setPopup({popup: "popup-c.html"});
sendClick({expectEvent: false, expectPopup: "c", closePopup: false});
sendClick({expectEvent: false, expectPopup: "c", waitUntilClosed: true});
},
() => {
browser.test.log(`Set popup to "b" and click browser action. Expect popup "b".`);
@ -120,7 +120,7 @@ function* testInArea(area) {
let expect = {};
sendClick = ({expectEvent, expectPopup, runNextTest, waitUntilClosed, closePopup}, message = "send-click") => {
if (closePopup == undefined) {
closePopup = true;
closePopup = !expectEvent;
}
expect = {event: expectEvent, popup: expectPopup, runNextTest, waitUntilClosed, closePopup};
@ -190,8 +190,11 @@ function* testInArea(area) {
CustomizableUI.addWidgetToArea(widget.id, area);
}
if (expecting.waitUntilClosed) {
yield new Promise(resolve => setTimeout(resolve, 0));
let panel = getBrowserActionPopup(extension);
if (panel && panel.state != "closed") {
info("Popup is open. Waiting for close");
yield promisePopupHidden(panel);
}
} else if (expecting.closePopupUsingWindow) {
@ -204,9 +207,16 @@ function* testInArea(area) {
yield promisePopupHidden(panel);
ok(true, "Panel is closed");
} else if (expecting.closePopup) {
if (!getBrowserActionPopup(extension)) {
info("Waiting for panel");
yield awaitExtensionPanel(extension);
}
info("Closing for panel");
yield closeBrowserAction(extension);
}
info("Starting next test");
extension.sendMessage("next-test");
}));
@ -225,189 +235,3 @@ add_task(function* testBrowserActionInToolbar() {
add_task(function* testBrowserActionInPanel() {
yield testInArea(CustomizableUI.AREA_PANEL);
});
add_task(function* testBrowserActionClickCanceled() {
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": true,
},
"permissions": ["activeTab"],
},
files: {
"popup.html": `<!DOCTYPE html><html><head><meta charset="utf-8"></head></html>`,
},
});
yield extension.startup();
const {GlobalManager, Management: {global: {browserActionFor}}} = Cu.import("resource://gre/modules/Extension.jsm", {});
let ext = GlobalManager.extensionMap.get(extension.id);
let browserAction = browserActionFor(ext);
let widget = getBrowserActionWidget(extension).forWindow(window);
let tab = window.gBrowser.selectedTab;
// Test canceled click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
isnot(browserAction.pendingPopup, null, "Have pending popup");
is(browserAction.pendingPopup.window, window, "Have pending popup for the correct window");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
is(browserAction.tabToRevokeDuringClearPopup, tab, "Tab to revoke was saved");
is(browserAction.tabManager.hasActiveTabPermission(tab), true, "Active tab was granted permission");
EventUtils.synthesizeMouseAtCenter(document.documentElement, {type: "mouseup", button: 0}, window);
is(browserAction.pendingPopup, null, "Pending popup was cleared");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
is(browserAction.tabToRevokeDuringClearPopup, null, "Tab to revoke was removed");
is(browserAction.tabManager.hasActiveTabPermission(tab), false, "Permission was revoked from tab");
// Test completed click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
isnot(browserAction.pendingPopup, null, "Have pending popup");
is(browserAction.pendingPopup.window, window, "Have pending popup for the correct window");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// We need to do these tests during the mouseup event cycle, since the click
// and command events will be dispatched immediately after mouseup, and void
// the results.
let mouseUpPromise = BrowserTestUtils.waitForEvent(widget.node, "mouseup", false, event => {
isnot(browserAction.pendingPopup, null, "Pending popup was not cleared");
isnot(browserAction.pendingPopupTimeout, null, "Have a pending popup timeout");
return true;
});
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, window);
yield mouseUpPromise;
is(browserAction.pendingPopup, null, "Pending popup was cleared");
is(browserAction.pendingPopupTimeout, null, "Pending popup timeout was cleared");
yield promisePopupShown(getBrowserActionPopup(extension));
yield closeBrowserAction(extension);
yield extension.unload();
});
add_task(function* testBrowserActionDisabled() {
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": true,
},
},
background() {
browser.browserAction.disable();
},
files: {
"popup.html": `<!DOCTYPE html><html><head><meta charset="utf-8"><script src="popup.js"></script></head></html>`,
"popup.js"() {
browser.test.fail("Should not get here");
},
},
});
yield extension.startup();
const {GlobalManager, Management: {global: {browserActionFor}}} = Cu.import("resource://gre/modules/Extension.jsm", {});
let ext = GlobalManager.extensionMap.get(extension.id);
let browserAction = browserActionFor(ext);
let widget = getBrowserActionWidget(extension).forWindow(window);
// Test canceled click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
EventUtils.synthesizeMouseAtCenter(document.documentElement, {type: "mouseup", button: 0}, window);
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// Test completed click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// We need to do these tests during the mouseup event cycle, since the click
// and command events will be dispatched immediately after mouseup, and void
// the results.
let mouseUpPromise = BrowserTestUtils.waitForEvent(widget.node, "mouseup", false, event => {
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
return true;
});
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, window);
yield mouseUpPromise;
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// Give the popup a chance to load and trigger a failure, if it was
// erroneously opened.
yield new Promise(resolve => setTimeout(resolve, 250));
yield extension.unload();
});
add_task(function* testBrowserActionTabPopulation() {
// Note: This test relates to https://bugzilla.mozilla.org/show_bug.cgi?id=1310019
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": true,
},
"permissions": ["activeTab"],
},
files: {
"popup.html": scriptPage("popup.js"),
"popup.js": function() {
browser.tabs.query({active: true, currentWindow: true}).then(tabs => {
browser.test.assertEq("mochitest index /",
tabs[0].title,
"Tab has the expected title on first click");
browser.test.sendMessage("tabTitle");
});
},
},
});
let win = yield BrowserTestUtils.openNewBrowserWindow();
yield BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, "http://example.com/");
yield BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
yield extension.startup();
let widget = getBrowserActionWidget(extension).forWindow(win);
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, win);
yield extension.awaitMessage("tabTitle");
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, win);
yield extension.unload();
yield BrowserTestUtils.closeWindow(win);
});

Просмотреть файл

@ -0,0 +1,191 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
let scriptPage = url => `<html><head><meta charset="utf-8"><script src="${url}"></script></head><body>${url}</body></html>`;
add_task(function* testBrowserActionClickCanceled() {
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": true,
},
"permissions": ["activeTab"],
},
files: {
"popup.html": `<!DOCTYPE html><html><head><meta charset="utf-8"></head></html>`,
},
});
yield extension.startup();
const {GlobalManager, Management: {global: {browserActionFor}}} = Cu.import("resource://gre/modules/Extension.jsm", {});
let ext = GlobalManager.extensionMap.get(extension.id);
let browserAction = browserActionFor(ext);
let widget = getBrowserActionWidget(extension).forWindow(window);
let tab = window.gBrowser.selectedTab;
// Test canceled click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
isnot(browserAction.pendingPopup, null, "Have pending popup");
is(browserAction.pendingPopup.window, window, "Have pending popup for the correct window");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
is(browserAction.tabToRevokeDuringClearPopup, tab, "Tab to revoke was saved");
is(browserAction.tabManager.hasActiveTabPermission(tab), true, "Active tab was granted permission");
EventUtils.synthesizeMouseAtCenter(document.documentElement, {type: "mouseup", button: 0}, window);
is(browserAction.pendingPopup, null, "Pending popup was cleared");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
is(browserAction.tabToRevokeDuringClearPopup, null, "Tab to revoke was removed");
is(browserAction.tabManager.hasActiveTabPermission(tab), false, "Permission was revoked from tab");
// Test completed click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
isnot(browserAction.pendingPopup, null, "Have pending popup");
is(browserAction.pendingPopup.window, window, "Have pending popup for the correct window");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// We need to do these tests during the mouseup event cycle, since the click
// and command events will be dispatched immediately after mouseup, and void
// the results.
let mouseUpPromise = BrowserTestUtils.waitForEvent(widget.node, "mouseup", false, event => {
isnot(browserAction.pendingPopup, null, "Pending popup was not cleared");
isnot(browserAction.pendingPopupTimeout, null, "Have a pending popup timeout");
return true;
});
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, window);
yield mouseUpPromise;
is(browserAction.pendingPopup, null, "Pending popup was cleared");
is(browserAction.pendingPopupTimeout, null, "Pending popup timeout was cleared");
yield promisePopupShown(getBrowserActionPopup(extension));
yield closeBrowserAction(extension);
yield extension.unload();
});
add_task(function* testBrowserActionDisabled() {
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": true,
},
},
background() {
browser.browserAction.disable();
},
files: {
"popup.html": `<!DOCTYPE html><html><head><meta charset="utf-8"><script src="popup.js"></script></head></html>`,
"popup.js"() {
browser.test.fail("Should not get here");
},
},
});
yield extension.startup();
const {GlobalManager, Management: {global: {browserActionFor}}} = Cu.import("resource://gre/modules/Extension.jsm", {});
let ext = GlobalManager.extensionMap.get(extension.id);
let browserAction = browserActionFor(ext);
let widget = getBrowserActionWidget(extension).forWindow(window);
// Test canceled click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
EventUtils.synthesizeMouseAtCenter(document.documentElement, {type: "mouseup", button: 0}, window);
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// Test completed click.
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, window);
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// We need to do these tests during the mouseup event cycle, since the click
// and command events will be dispatched immediately after mouseup, and void
// the results.
let mouseUpPromise = BrowserTestUtils.waitForEvent(widget.node, "mouseup", false, event => {
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
return true;
});
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, window);
yield mouseUpPromise;
is(browserAction.pendingPopup, null, "Have no pending popup");
is(browserAction.pendingPopupTimeout, null, "Have no pending popup timeout");
// Give the popup a chance to load and trigger a failure, if it was
// erroneously opened.
yield new Promise(resolve => setTimeout(resolve, 250));
yield extension.unload();
});
add_task(function* testBrowserActionTabPopulation() {
// Note: This test relates to https://bugzilla.mozilla.org/show_bug.cgi?id=1310019
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": true,
},
"permissions": ["activeTab"],
},
files: {
"popup.html": scriptPage("popup.js"),
"popup.js": function() {
browser.tabs.query({active: true, currentWindow: true}).then(tabs => {
browser.test.assertEq("mochitest index /",
tabs[0].title,
"Tab has the expected title on first click");
browser.test.sendMessage("tabTitle");
});
},
},
});
let win = yield BrowserTestUtils.openNewBrowserWindow();
yield BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, "http://example.com/");
yield BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
yield extension.startup();
let widget = getBrowserActionWidget(extension).forWindow(win);
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, win);
yield extension.awaitMessage("tabTitle");
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, win);
yield extension.unload();
yield BrowserTestUtils.closeWindow(win);
});

Просмотреть файл

@ -24,7 +24,7 @@ add_task(function* testBrowserActionPopupResize() {
yield extension.startup();
let browser = yield openPanel(extension);
let browser = yield openPanel(extension, undefined, true);
function* checkSize(expected) {
let dims = yield promiseContentDimensions(browser);

Просмотреть файл

@ -82,6 +82,10 @@ function* testExecuteBrowserActionWithOptions(options = {}) {
if (options.withPopup) {
yield extension.awaitFinish("execute-browser-action-popup-opened");
if (!getBrowserActionPopup(extension)) {
yield awaitExtensionPanel(extension);
}
yield closeBrowserAction(extension);
} else {
yield extension.awaitFinish("execute-browser-action-on-clicked-fired");

Просмотреть файл

@ -39,8 +39,17 @@ add_task(function* testPageActionPopupResize() {
browser = yield awaitExtensionPanel(extension);
function* checkSize(expected) {
function* waitForSize(size) {
let dims = yield promiseContentDimensions(browser);
for (let i = 0; i < 100 && dims.window.innerWidth != size; i++) {
yield delay(50);
dims = yield promiseContentDimensions(browser);
}
return dims;
}
function* checkSize(expected) {
let dims = yield waitForSize(expected);
let {body, root} = dims;
is(dims.window.innerHeight, expected, `Panel window should be ${expected}px tall`);
@ -76,16 +85,9 @@ add_task(function* testPageActionPopupResize() {
yield alterContent(browser, setSize, 1400);
let dims = yield promiseContentDimensions(browser);
let dims = yield waitForSize(800);
let {body, root} = dims;
if (AppConstants.platform == "win") {
while (dims.window.innerWidth < 800) {
yield delay(50);
dims = yield promiseContentDimensions(browser);
}
}
is(dims.window.innerWidth, 800, "Panel window width");
ok(body.clientWidth <= 800, `Panel body width ${body.clientWidth} is less than 800`);
is(body.scrollWidth, 1400, "Panel body scroll width");

Просмотреть файл

@ -61,7 +61,7 @@ add_task(function* testPageActionPopup() {
let awaitMessage = promiseConsoleMessage(/WebExt Privilege Escalation: BrowserAction/);
SimpleTest.expectUncaughtException();
yield clickBrowserAction(extension);
yield promisePopupShown(getBrowserActionPopup(extension));
yield awaitExtensionPanel(extension);
let message = yield awaitMessage;
ok(message.includes("WebExt Privilege Escalation: BrowserAction: typeof(browser) = undefined"),
@ -89,8 +89,8 @@ add_task(function* testPageActionPopup() {
yield clickBrowserAction(extension);
yield awaitExtensionPanel(extension);
yield extension.awaitMessage("from-popup-a");
yield promisePopupShown(getBrowserActionPopup(extension));
yield closeBrowserAction(extension);
yield clickPageAction(extension);

Просмотреть файл

@ -5,30 +5,45 @@
add_task(function* testTabEvents() {
async function background() {
let events = [];
let eventPromise;
let checkEvents = () => {
if (eventPromise && events.length >= eventPromise.names.length) {
eventPromise.resolve();
}
};
browser.tabs.onCreated.addListener(tab => {
events.push({type: "onCreated", tab});
checkEvents();
});
browser.tabs.onAttached.addListener((tabId, info) => {
events.push(Object.assign({type: "onAttached", tabId}, info));
checkEvents();
});
browser.tabs.onDetached.addListener((tabId, info) => {
events.push(Object.assign({type: "onDetached", tabId}, info));
checkEvents();
});
browser.tabs.onRemoved.addListener((tabId, info) => {
events.push(Object.assign({type: "onRemoved", tabId}, info));
checkEvents();
});
browser.tabs.onMoved.addListener((tabId, info) => {
events.push(Object.assign({type: "onMoved", tabId}, info));
checkEvents();
});
async function expectEvents(names) {
browser.test.log(`Expecting events: ${names.join(", ")}`);
await new Promise(resolve => setTimeout(resolve, 0));
await new Promise(resolve => {
eventPromise = {names, resolve};
checkEvents();
});
browser.test.assertEq(names.length, events.length, "Got expected number of events");
for (let [i, name] of names.entries()) {

Просмотреть файл

@ -3,6 +3,7 @@
"use strict";
add_task(function* testExecuteScript() {
let {ExtensionManagement} = Cu.import("resource://gre/modules/ExtensionManagement.jsm", {});
let {MessageChannel} = Cu.import("resource://gre/modules/MessageChannel.jsm", {});
function countMM(messageManagerMap) {
@ -249,6 +250,8 @@ add_task(function* testExecuteScript() {
// Make sure that we're not holding on to references to closed message
// managers.
is(countMM(MessageChannel.messageManagers), messageManagersSize, "Message manager count");
is(countMM(MessageChannel.responseManagers), responseManagersSize, "Response manager count");
if (!ExtensionManagement.useRemoteWebExtensions) {
is(countMM(MessageChannel.responseManagers), responseManagersSize, "Response manager count");
}
is(MessageChannel.pendingResponses.size, 0, "Pending response count");
});

Просмотреть файл

@ -43,6 +43,7 @@ add_task(function* testWindowCreate() {
async function create(options) {
let window = await browser.windows.create(options);
let win = windows.get(window.id);
win.id = window.id;
win.expectedTabs = Array.isArray(options.url) ? options.url.length : 1;
@ -66,7 +67,9 @@ add_task(function* testWindowCreate() {
browser.test.assertEq(EXTENSION_URL, windows[3].tabs.get(1).url, "url[1]: Relative URL");
browser.test.assertEq(EXTENSION_URL, windows[3].tabs.get(2).url, "url[2]: Absolute, extension URL");
browser.test.notifyPass("window-create-url");
Promise.all(windows.map(({id}) => browser.windows.remove(id))).then(() => {
browser.test.notifyPass("window-create-url");
});
} catch (e) {
browser.test.fail(`${e} :: ${e.stack}`);
browser.test.notifyFail("window-create-url");

Просмотреть файл

@ -18,6 +18,19 @@
var {AppConstants} = Cu.import("resource://gre/modules/AppConstants.jsm");
var {CustomizableUI} = Cu.import("resource:///modules/CustomizableUI.jsm");
// We run tests under two different configurations, from browser.ini and
// browser-remote.ini. When running from browser-remote.ini, the tests are
// copied to the sub-directory "test-oop-extensions", which we detect here, and
// use to select our configuration.
if (gTestPath.includes("test-oop-extensions")) {
add_task(() => {
return SpecialPowers.pushPrefEnv({set: [
["dom.ipc.processCount", 1],
["extensions.webextensions.remote", true],
]});
});
}
// Bug 1239884: Our tests occasionally hit a long GC pause at unpredictable
// times in debug builds, which results in intermittent timeouts. Until we have
// a better solution, we force a GC after certain strategic tests, which tend to
@ -132,7 +145,7 @@ function getPanelForNode(node) {
var awaitBrowserLoaded = browser => ContentTask.spawn(browser, null, () => {
if (content.document.readyState !== "complete") {
return ContentTaskUtils.waitForEvent(content, "load").then(() => {});
return ContentTaskUtils.waitForEvent(this, "load", true).then(() => {});
}
});
@ -144,7 +157,7 @@ var awaitExtensionPanel = Task.async(function* (extension, win = window, awaitLo
yield Promise.all([
promisePopupShown(getPanelForNode(browser)),
awaitLoad && awaitBrowserLoaded(browser),
awaitLoad && awaitBrowserLoaded(browser, awaitLoad),
]);
return browser;

Просмотреть файл

@ -15,11 +15,10 @@ function makeBookmarkFor(url, keyword) {
add_task(function* openKeywordBookmarkWithWindowOpen() {
// This is the current default, but let's not assume that...
yield new Promise((resolve, reject) => {
SpecialPowers.pushPrefEnv({ 'set': [[ 'browser.link.open_newwindow', 3 ],
[ 'dom.disable_open_during_load', true ]] },
resolve);
});
yield SpecialPowers.pushPrefEnv({"set": [
[ 'browser.link.open_newwindow', 3 ],
[ 'dom.disable_open_during_load', true ]
]});
let moztab;
let tabOpened = BrowserTestUtils.openNewForegroundTab(gBrowser, "about:mozilla")

Просмотреть файл

@ -10,7 +10,7 @@ add_task(function* () {
var contextMenu;
// We want select events to be fired.
yield new Promise(resolve => SpecialPowers.pushPrefEnv({"set": [["dom.select_events.enabled", true]]}, resolve));
yield SpecialPowers.pushPrefEnv({set: [["dom.select_events.enabled", true]]});
let envService = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
let originalValue = envService.get("XPCSHELL_TEST_PROFILE_DIR");

Просмотреть файл

@ -15,6 +15,8 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Utils",
"resource://gre/modules/sessionstore/Utils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "uuidGenerator",
"@mozilla.org/uuid-generator;1", "nsIUUIDGenerator");
function debug(msg) {
Services.console.logStringMessage("SessionHistory: " + msg);
@ -41,6 +43,11 @@ this.SessionHistory = Object.freeze({
* The internal API for the SessionHistory module.
*/
var SessionHistoryInternal = {
/**
* Mapping from legacy docshellIDs to docshellUUIDs.
*/
_docshellUUIDMap: new Map(),
/**
* Returns whether the given docShell's session history is empty.
*
@ -132,7 +139,7 @@ var SessionHistoryInternal = {
entry.cacheKey = cacheKey.data;
}
entry.ID = shEntry.ID;
entry.docshellID = shEntry.docshellID;
entry.docshellUUID = shEntry.docshellID.toString();
// We will include the property only if it's truthy to save a couple of
// bytes when the resulting object is stringified and saved to disk.
@ -328,8 +335,22 @@ var SessionHistoryInternal = {
shEntry.ID = id;
}
if (entry.docshellID)
shEntry.docshellID = entry.docshellID;
// If we have the legacy docshellID on our entry, upgrade it to a
// docshellUUID by going through the mapping.
if (entry.docshellID) {
if (!this._docshellUUIDMap.has(entry.docshellID)) {
// Convert the nsID to a string so that the docshellUUID property
// is correctly stored as a string.
this._docshellUUIDMap.set(entry.docshellID,
uuidGenerator.generateUUID().toString());
}
entry.docshellUUID = this._docshellUUIDMap.get(entry.docshellID);
delete entry.docshellID;
}
if (entry.docshellUUID) {
shEntry.docshellID = Components.ID(entry.docshellUUID);
}
if (entry.structuredCloneState && entry.structuredCloneVersion) {
shEntry.stateData =

Просмотреть файл

@ -237,3 +237,4 @@ run-if = e10s && crashreporter
# Disabled on debug for frequent intermittent failures:
[browser_undoCloseById.js]
skip-if = debug
[browser_docshell_uuid_consistency.js]

Просмотреть файл

@ -0,0 +1,65 @@
// First test - open a tab and duplicate it, using session restore to restore the history into the new tab.
add_task(function* duplicateTab () {
const TEST_URL = "data:text/html,foo";
let tab = gBrowser.addTab(TEST_URL);
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
yield ContentTask.spawn(tab.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let shEntry = docshell.sessionHistory.getEntryAtIndex(0, false);
is(shEntry.docshellID.toString(), docshell.historyID.toString());
});
let tab2 = gBrowser.duplicateTab(tab);
yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
yield ContentTask.spawn(tab2.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let shEntry = docshell.sessionHistory.getEntryAtIndex(0, false);
is(shEntry.docshellID.toString(), docshell.historyID.toString());
});
yield BrowserTestUtils.removeTab(tab);
yield BrowserTestUtils.removeTab(tab2);
});
// Second test - open a tab and navigate across processes, which triggers sessionrestore to persist history.
add_task(function* contentToChromeNavigate() {
const TEST_URL = "data:text/html,foo";
let tab = gBrowser.addTab(TEST_URL);
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
yield ContentTask.spawn(tab.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let sh = docshell.sessionHistory;
is(sh.count, 1);
is(sh.getEntryAtIndex(0, false).docshellID.toString(), docshell.historyID.toString());
});
// Force the browser to navigate to the chrome process.
yield ContentTask.spawn(tab.linkedBrowser, null, function() {
const CHROME_URL = "about:config";
let webnav = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
webnav.loadURI(CHROME_URL, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
});
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
// Check to be sure that we're in the chrome process.
let docShell = tab.linkedBrowser.frameLoader.docShell;
// 'cause we're in the chrome process, we can just directly poke at the shistory.
let sh = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory;
is(sh.count, 2);
is(sh.getEntryAtIndex(0, false).docshellID.toString(), docShell.historyID.toString());
is(sh.getEntryAtIndex(1, false).docshellID.toString(), docShell.historyID.toString());
yield BrowserTestUtils.removeTab(tab);
});

Просмотреть файл

@ -544,15 +544,11 @@ function modifySessionStorage(browser, data, options = {}) {
}
function pushPrefs(...aPrefs) {
return new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": aPrefs}, resolve);
});
return SpecialPowers.pushPrefEnv({"set": aPrefs});
}
function popPrefs() {
return new Promise(resolve => {
SpecialPowers.popPrefEnv(resolve);
});
return SpecialPowers.popPrefEnv();
}
function* checkScroll(tab, expected, msg) {

Просмотреть файл

@ -9,6 +9,10 @@ this.EXPORTED_SYMBOLS = ["E10SUtils"];
const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyPreferenceGetter(this, "useRemoteWebExtensions",
"extensions.webextensions.remote", false);
function getAboutModule(aURL) {
// Needs to match NS_GetAboutModuleName
@ -61,6 +65,7 @@ this.E10SUtils = {
canLoadRemote = true;
mustLoadRemote = false;
}
if (url) {
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].
getService(Ci.nsIXULChromeRegistry);
@ -70,8 +75,8 @@ this.E10SUtils = {
}
if (aURL.startsWith("moz-extension:")) {
canLoadRemote = false;
mustLoadRemote = false;
canLoadRemote = useRemoteWebExtensions;
mustLoadRemote = useRemoteWebExtensions;
}
if (aURL.startsWith("view-source:")) {

Просмотреть файл

@ -28,17 +28,11 @@ function promiseReportCallMade(aValue) {
}
function pushPrefs(...aPrefs) {
return new Promise((resolve) => {
SpecialPowers.pushPrefEnv({"set": aPrefs}, resolve);
resolve();
});
return SpecialPowers.pushPrefEnv({"set": aPrefs});
}
function popPrefs() {
return new Promise((resolve) => {
SpecialPowers.popPrefEnv(resolve);
resolve();
});
return SpecialPowers.popPrefEnv();
}
let gTestHangReport = {

Просмотреть файл

@ -63,7 +63,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=995943
}
function pushPrefs(prefs) {
return new Promise(function(resolve) { SpecialPowers.pushPrefEnv({ set: prefs }, resolve); });
return SpecialPowers.pushPrefEnv({ set: prefs });
}
function popPrefs() {

Двоичные данные
config/external/icu/data/icudt58l.dat поставляемый

Двоичный файл не отображается.

Просмотреть файл

@ -16,7 +16,7 @@ function DebuggerPanel(iframeWindow, toolbox) {
}
DebuggerPanel.prototype = {
open: Task.async(function*() {
open: Task.async(function* () {
if (!this.toolbox.target.isRemote) {
yield this.toolbox.target.makeRemote();
}
@ -30,31 +30,31 @@ DebuggerPanel.prototype = {
return this;
}),
_store: function() {
_store: function () {
return this.panelWin.Debugger.store;
},
_getState: function() {
_getState: function () {
return this._store().getState();
},
_actions: function() {
_actions: function () {
return this.panelWin.Debugger.actions;
},
_selectors: function() {
_selectors: function () {
return this.panelWin.Debugger.selectors;
},
getFrames: function() {
getFrames: function () {
let frames = this._selectors().getFrames(this._getState());
// frames is an empty array when the debugger is not paused
if (!frames.toJS) {
// Frames is null when the debugger is not paused.
if (!frames) {
return {
frames: [],
selected: -1
}
};
}
frames = frames.toJS();
@ -68,7 +68,7 @@ DebuggerPanel.prototype = {
return { frames, selected };
},
destroy: function() {
destroy: function () {
this.panelWin.Debugger.destroy();
this.emit("destroyed");
}

Просмотреть файл

@ -1,3 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"react-redux" uses UMD style loading to work in many different environments.
It assumes that "react" and "redux" are both included via `require("react")`
as in node or browserify, but the paths to our react and redux installation are different.

Просмотреть файл

@ -1,3 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
We use a version of React that has a few minor tweaks. We want to use
an un-minified production version anyway, and because of all of this
you need to build React yourself to upgrade it for devtools.

Просмотреть файл

@ -1,3 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"react-virtualized" uses UMD style loading to work in many different environments.
It assumes that "react", "react-addons-shallow-compare", and "react-dom" are all included
separately via require statements. The paths to our installations are different.

Просмотреть файл

@ -1,3 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
REDUX_UPGRADING
Current version of redux : 3.3.0

Просмотреть файл

@ -1,3 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Follow these steps when adding/upgrading the reselect.js module:
1. git clone https://github.com/reactjs/reselect - clone the repo

Просмотреть файл

@ -1,6 +1,9 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#0b0b0b">
<path d="M11.1 2H3.8c-.4 0-.8.4-.8.9v11.2c0 .4.3.9.8.9h7.3c.4 0 .9-.4.9-.9V2.9s-.7-.9-.9-.9zM11 14H4v-3h7v3zm0-4H4V3h7v7z"/>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" stroke="#0b0b0b" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" fill="transparent">
<circle cx="-5.5" cy="8.5" r="1"/>
<path d="M3.8 1.5h7.5v13H3.8z"/>
<path d="M11.2 8.5H3.8"/>
<circle cx="7.5" cy="11.5" r="1"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 422 B

После

Ширина:  |  Высота:  |  Размер: 546 B

Просмотреть файл

@ -49,8 +49,8 @@ rule.userAgentStyles=(user agent)
# pseudo element header
rule.pseudoElement=Pseudo-elements
# LOCALIZATION NOTE (rule.pseudoElement): Shown for CSS rules
# pseudo element header
# LOCALIZATION NOTE (rule.selectedElement): Shown for CSS rules element header if
# pseudo elements are present in the rule view.
rule.selectedElement=This Element
# LOCALIZATION NOTE (rule.warning.title): When an invalid property value is

Просмотреть файл

@ -85,6 +85,7 @@ public:
, mIsNotNull(true)
#endif
{
MOZ_DIAGNOSTIC_ASSERT(aUsePrivateBrowsing == (aAttrs.mPrivateBrowsingId > 0));
}
// Constructor taking reserved origin attributes.

Просмотреть файл

@ -750,8 +750,6 @@ DecreasePrivateDocShellCount()
}
}
static uint64_t gDocshellIDCounter = 0;
nsDocShell::nsDocShell()
: nsDocLoader()
, mDefaultScrollbarPref(Scrollbar_Auto, Scrollbar_Auto)
@ -820,7 +818,9 @@ nsDocShell::nsDocShell()
, mTouchEventsOverride(nsIDocShell::TOUCHEVENTS_OVERRIDE_NONE)
{
AssertOriginAttributesMatchPrivateBrowsing();
mHistoryID = ++gDocshellIDCounter;
nsContentUtils::GenerateUUIDInPlace(mHistoryID);
if (gDocShellCount++ == 0) {
NS_ASSERTION(sURIFixup == nullptr,
"Huh, sURIFixup not null in first nsDocShell ctor!");
@ -834,11 +834,11 @@ nsDocShell::nsDocShell()
// We're counting the number of |nsDocShells| to help find leaks
++gNumberOfDocShells;
if (!PR_GetEnv("MOZ_QUIET")) {
printf_stderr("++DOCSHELL %p == %ld [pid = %d] [id = %llu]\n",
printf_stderr("++DOCSHELL %p == %ld [pid = %d] [id = %s]\n",
(void*)this,
gNumberOfDocShells,
getpid(),
AssertedCast<unsigned long long>(mHistoryID));
nsIDToCString(mHistoryID).get());
}
#endif
}
@ -866,11 +866,11 @@ nsDocShell::~nsDocShell()
// We're counting the number of |nsDocShells| to help find leaks
--gNumberOfDocShells;
if (!PR_GetEnv("MOZ_QUIET")) {
printf_stderr("--DOCSHELL %p == %ld [pid = %d] [id = %llu]\n",
printf_stderr("--DOCSHELL %p == %ld [pid = %d] [id = %s]\n",
(void*)this,
gNumberOfDocShells,
getpid(),
AssertedCast<unsigned long long>(mHistoryID));
nsIDToCString(mHistoryID).get());
}
#endif
}
@ -4037,12 +4037,18 @@ nsDocShell::SetChildOffset(uint32_t aChildOffset)
}
NS_IMETHODIMP
nsDocShell::GetHistoryID(uint64_t* aID)
nsDocShell::GetHistoryID(nsID** aID)
{
*aID = mHistoryID;
*aID = static_cast<nsID*>(nsMemory::Clone(&mHistoryID, sizeof(nsID)));
return NS_OK;
}
const nsID
nsDocShell::HistoryID()
{
return mHistoryID;
}
NS_IMETHODIMP
nsDocShell::GetIsInUnload(bool* aIsInUnload)
{
@ -4494,7 +4500,7 @@ nsDocShell::RemoveFromSessionHistory()
int32_t index = 0;
sessionHistory->GetIndex(&index);
AutoTArray<uint64_t, 16> ids({mHistoryID});
AutoTArray<nsID, 16> ids({mHistoryID});
internalHistory->RemoveEntries(ids, index);
return NS_OK;
}
@ -4584,14 +4590,12 @@ nsDocShell::ClearFrameHistory(nsISHEntry* aEntry)
int32_t count = 0;
shcontainer->GetChildCount(&count);
AutoTArray<uint64_t, 16> ids;
AutoTArray<nsID, 16> ids;
for (int32_t i = 0; i < count; ++i) {
nsCOMPtr<nsISHEntry> child;
shcontainer->GetChildAt(i, getter_AddRefs(child));
if (child) {
uint64_t id = 0;
child->GetDocshellID(&id);
ids.AppendElement(id);
ids.AppendElement(child->DocshellID());
}
}
int32_t index = 0;
@ -10608,7 +10612,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
if (aSHEntry && (mLoadType & LOAD_CMD_HISTORY)) {
// Make sure our history ID points to the same ID as
// SHEntry's docshell ID.
aSHEntry->GetDocshellID(&mHistoryID);
mHistoryID = aSHEntry->DocshellID();
// It's possible that the previous viewer of mContentViewer is the
// viewer that will end up in aSHEntry when it gets closed. If that's

Просмотреть файл

@ -998,7 +998,7 @@ protected:
bool mInEnsureScriptEnv;
#endif
uint64_t mHistoryID;
nsID mHistoryID;
uint32_t mDefaultLoadFlags;
static nsIURIFixup* sURIFixup;

Просмотреть файл

@ -678,7 +678,12 @@ interface nsIDocShell : nsIDocShellTreeItem
/**
* The ID of the docshell in the session history.
*/
readonly attribute unsigned long long historyID;
readonly attribute nsIDPtr historyID;
/**
* Helper method for accessing this value from C++
*/
[noscript, notxpcom] nsID HistoryID();
/**
* Sets whether a docshell is an app tab. An app tab docshell may behave

Просмотреть файл

@ -193,7 +193,7 @@ interface nsISHEntry : nsISupports
in nsISupports cacheKey, in ACString contentType,
in nsIPrincipal triggeringPrincipal,
in nsIPrincipal principalToInherit,
in unsigned long long docshellID,
in nsIDRef docshellID,
in boolean dynamicCreation);
nsISHEntry clone();
@ -257,7 +257,12 @@ interface nsISHEntry : nsISupports
/**
* The history ID of the docshell.
*/
attribute unsigned long long docshellID;
attribute nsIDPtr docshellID;
/**
* Helper method for accessing this value from C++
*/
[noscript, notxpcom] nsID DocshellID();
readonly attribute nsIBFCacheEntry BFCacheEntry;

Просмотреть файл

@ -22,7 +22,7 @@ interface nsIURI;
#include "nsTArrayForwardDeclare.h"
%}
[ref] native nsDocshellIDArray(nsTArray<uint64_t>);
[ref] native nsDocshellIDArray(nsTArray<nsID>);
[scriptable, uuid(3dfb2f54-378d-4d3c-a9f9-95dd2673248c)]
interface nsISHistoryInternal: nsISupports

Просмотреть файл

@ -413,7 +413,7 @@ nsSHEntry::Create(nsIURI* aURI, const nsAString& aTitle,
nsISupports* aCacheKey, const nsACString& aContentType,
nsIPrincipal* aTriggeringPrincipal,
nsIPrincipal* aPrincipalToInherit,
uint64_t aDocShellID,
const nsID& aDocShellID,
bool aDynamicCreation)
{
mURI = aURI;
@ -785,13 +785,10 @@ nsSHEntry::ReplaceChild(nsISHEntry* aNewEntry)
{
NS_ENSURE_STATE(aNewEntry);
uint64_t docshellID;
aNewEntry->GetDocshellID(&docshellID);
nsID docshellID = aNewEntry->DocshellID();
uint64_t otherID;
for (int32_t i = 0; i < mChildren.Count(); ++i) {
if (mChildren[i] && NS_SUCCEEDED(mChildren[i]->GetDocshellID(&otherID)) &&
docshellID == otherID) {
if (mChildren[i] && docshellID == mChildren[i]->DocshellID()) {
mChildren[i]->SetParent(nullptr);
mChildren.ReplaceObjectAt(aNewEntry, i);
return aNewEntry->SetParent(this);
@ -916,16 +913,22 @@ nsSHEntry::HasDynamicallyAddedChild(bool* aAdded)
}
NS_IMETHODIMP
nsSHEntry::GetDocshellID(uint64_t* aID)
nsSHEntry::GetDocshellID(nsID** aID)
{
*aID = mShared->mDocShellID;
*aID = static_cast<nsID*>(nsMemory::Clone(&mShared->mDocShellID, sizeof(nsID)));
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::SetDocshellID(uint64_t aID)
const nsID
nsSHEntry::DocshellID()
{
mShared->mDocShellID = aID;
return mShared->mDocShellID;
}
NS_IMETHODIMP
nsSHEntry::SetDocshellID(const nsID* aID)
{
mShared->mDocShellID = *aID;
return NS_OK;
}

Просмотреть файл

@ -72,7 +72,7 @@ nsSHEntryShared::Shutdown()
}
nsSHEntryShared::nsSHEntryShared()
: mDocShellID(0)
: mDocShellID({0})
, mIsFrameNavigation(false)
, mSaveLayoutState(true)
, mSticky(true)

Просмотреть файл

@ -68,7 +68,7 @@ private:
// These members are copied by nsSHEntryShared::Duplicate(). If you add a
// member here, be sure to update the Duplicate() implementation.
uint64_t mDocShellID;
nsID mDocShellID;
nsCOMArray<nsIDocShellTreeItem> mChildShells;
nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
nsCOMPtr<nsIPrincipal> mPrincipalToInherit;

Просмотреть файл

@ -379,6 +379,13 @@ nsSHistory::AddEntry(nsISHEntry* aSHEntry, bool aPersist)
{
NS_ENSURE_ARG(aSHEntry);
// If we have a root docshell, update the docshell id of the root shentry to
// match the id of that docshell
if (mRootDocShell) {
nsID docshellID = mRootDocShell->HistoryID();
aSHEntry->SetDocshellID(&docshellID);
}
nsCOMPtr<nsISHTransaction> currentTxn;
if (mListRoot) {
@ -1277,7 +1284,7 @@ nsSHistory::GloballyEvictAllContentViewers()
void
GetDynamicChildren(nsISHContainer* aContainer,
nsTArray<uint64_t>& aDocshellIDs,
nsTArray<nsID>& aDocshellIDs,
bool aOnlyTopLevelDynamic)
{
int32_t count = 0;
@ -1289,8 +1296,7 @@ GetDynamicChildren(nsISHContainer* aContainer,
bool dynAdded = false;
child->IsDynamicallyAdded(&dynAdded);
if (dynAdded) {
uint64_t docshellID = 0;
child->GetDocshellID(&docshellID);
nsID docshellID = child->DocshellID();
aDocshellIDs.AppendElement(docshellID);
}
if (!dynAdded || !aOnlyTopLevelDynamic) {
@ -1306,7 +1312,7 @@ GetDynamicChildren(nsISHContainer* aContainer,
bool
RemoveFromSessionHistoryContainer(nsISHContainer* aContainer,
nsTArray<uint64_t>& aDocshellIDs)
nsTArray<nsID>& aDocshellIDs)
{
nsCOMPtr<nsISHEntry> root = do_QueryInterface(aContainer);
NS_ENSURE_TRUE(root, false);
@ -1318,8 +1324,7 @@ RemoveFromSessionHistoryContainer(nsISHContainer* aContainer,
nsCOMPtr<nsISHEntry> child;
aContainer->GetChildAt(i, getter_AddRefs(child));
if (child) {
uint64_t docshelldID = 0;
child->GetDocshellID(&docshelldID);
nsID docshelldID = child->DocshellID();
if (aDocshellIDs.Contains(docshelldID)) {
didRemove = true;
aContainer->RemoveChild(child);
@ -1340,7 +1345,7 @@ RemoveFromSessionHistoryContainer(nsISHContainer* aContainer,
bool
RemoveChildEntries(nsISHistory* aHistory, int32_t aIndex,
nsTArray<uint64_t>& aEntryIDs)
nsTArray<nsID>& aEntryIDs)
{
nsCOMPtr<nsISHEntry> rootHE;
aHistory->GetEntryAtIndex(aIndex, false, getter_AddRefs(rootHE));
@ -1455,7 +1460,7 @@ nsSHistory::RemoveDuplicate(int32_t aIndex, bool aKeepNext)
}
NS_IMETHODIMP_(void)
nsSHistory::RemoveEntries(nsTArray<uint64_t>& aIDs, int32_t aStartIndex)
nsSHistory::RemoveEntries(nsTArray<nsID>& aIDs, int32_t aStartIndex)
{
int32_t index = aStartIndex;
while (index >= 0 && RemoveChildEntries(this, --index, aIDs)) {
@ -1487,16 +1492,16 @@ nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex)
nsCOMPtr<nsISHEntry> originalSH;
GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH));
nsCOMPtr<nsISHContainer> originalContainer = do_QueryInterface(originalSH);
AutoTArray<uint64_t, 16> toBeRemovedEntries;
AutoTArray<nsID, 16> toBeRemovedEntries;
if (originalContainer) {
nsTArray<uint64_t> originalDynDocShellIDs;
nsTArray<nsID> originalDynDocShellIDs;
GetDynamicChildren(originalContainer, originalDynDocShellIDs, true);
if (originalDynDocShellIDs.Length()) {
nsCOMPtr<nsISHEntry> currentSH;
GetEntryAtIndex(aNewIndex, false, getter_AddRefs(currentSH));
nsCOMPtr<nsISHContainer> newContainer = do_QueryInterface(currentSH);
if (newContainer) {
nsTArray<uint64_t> newDynDocShellIDs;
nsTArray<nsID> newDynDocShellIDs;
GetDynamicChildren(newContainer, newDynDocShellIDs, false);
for (uint32_t i = 0; i < originalDynDocShellIDs.Length(); ++i) {
if (!newDynDocShellIDs.Contains(originalDynDocShellIDs[i])) {
@ -1775,16 +1780,14 @@ nsSHistory::LoadDifferingEntries(nsISHEntry* aPrevEntry, nsISHEntry* aNextEntry,
if (!nChild) {
continue;
}
uint64_t docshellID = 0;
nChild->GetDocshellID(&docshellID);
nsID docshellID = nChild->DocshellID();
// Then find the associated docshell.
nsIDocShell* dsChild = nullptr;
int32_t count = docshells.Count();
for (int32_t j = 0; j < count; ++j) {
uint64_t shellID = 0;
nsIDocShell* shell = docshells[j];
shell->GetHistoryID(&shellID);
nsID shellID = shell->HistoryID();
if (shellID == docshellID) {
dsChild = shell;
break;
@ -1801,8 +1804,7 @@ nsSHistory::LoadDifferingEntries(nsISHEntry* aPrevEntry, nsISHEntry* aNextEntry,
nsCOMPtr<nsISHEntry> child;
prevContainer->GetChildAt(k, getter_AddRefs(child));
if (child) {
uint64_t dID = 0;
child->GetDocshellID(&dID);
nsID dID = child->DocshellID();
if (dID == docshellID) {
pChild = child;
break;

Просмотреть файл

@ -59,6 +59,7 @@ support-files = bug530396-noref.sjs bug530396-subframe.html
[test_bug540462.html]
[test_bug551225.html]
[test_bug570341.html]
skip-if = toolkit == 'android' && debug # Bug 1040769
[test_bug580069.html]
[test_bug590573.html]
[test_bug598895.html]

Просмотреть файл

@ -236,11 +236,9 @@ promise_test(function(t) {
// This is to test that we don't temporarily clear the flag when forcing
// an unthrottled sample.
promise_test(function(t) {
return new Promise(function(resolve) {
// Needs scrollbars to cause overflow.
SpecialPowers.pushPrefEnv({ set: [["ui.showHideScrollbars", 1]] },
resolve);
}).then(function() {
// Needs scrollbars to cause overflow.
return SpecialPowers.pushPrefEnv({ set: [["ui.showHideScrollbars", 1]] })
.then(function() {
var div = addDiv(t, { style: 'animation: rotate 100s' });
var animation = div.getAnimations()[0];

Просмотреть файл

@ -6,9 +6,7 @@
'use strict';
function waitForSetPref(pref, value) {
return new Promise(function(resolve, reject) {
SpecialPowers.pushPrefEnv({ 'set': [[pref, value]] }, resolve);
});
return SpecialPowers.pushPrefEnv({ 'set': [[pref, value]] });
}
/*

Просмотреть файл

@ -1,824 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
"resource://gre/modules/FileUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
// Shared code for Webapps.jsm and Webapps.js
this.EXPORTED_SYMBOLS =
["AppsUtils", "ManifestHelper", "isAbsoluteURI"];
function debug(s) {
//dump("-*- AppsUtils.jsm: " + s + "\n");
}
this.isAbsoluteURI = function(aURI) {
let foo = Services.io.newURI("http://foo", null, null);
let bar = Services.io.newURI("http://bar", null, null);
return Services.io.newURI(aURI, null, foo).prePath != foo.prePath ||
Services.io.newURI(aURI, null, bar).prePath != bar.prePath;
}
function _setAppProperties(aObj, aApp) {
aObj.name = aApp.name;
aObj.csp = aApp.csp;
aObj.installOrigin = aApp.installOrigin;
aObj.origin = aApp.origin;
#ifdef MOZ_WIDGET_ANDROID
aObj.apkPackageName = aApp.apkPackageName;
#endif
aObj.receipts = aApp.receipts ? JSON.parse(JSON.stringify(aApp.receipts)) : null;
aObj.installTime = aApp.installTime;
aObj.manifestURL = aApp.manifestURL;
aObj.appStatus = aApp.appStatus;
aObj.removable = aApp.removable;
aObj.id = aApp.id;
aObj.localId = aApp.localId;
aObj.basePath = aApp.basePath;
aObj.progress = aApp.progress || 0.0;
aObj.installState = aApp.installState || "installed";
aObj.downloadAvailable = aApp.downloadAvailable;
aObj.downloading = aApp.downloading;
aObj.readyToApplyDownload = aApp.readyToApplyDownload;
aObj.downloadSize = aApp.downloadSize || 0;
aObj.lastUpdateCheck = aApp.lastUpdateCheck;
aObj.updateTime = aApp.updateTime;
aObj.etag = aApp.etag;
aObj.packageEtag = aApp.packageEtag;
aObj.manifestHash = aApp.manifestHash;
aObj.packageHash = aApp.packageHash;
aObj.staged = aApp.staged;
aObj.installerAppId = aApp.installerAppId || Ci.nsIScriptSecurityManager.NO_APP_ID;
aObj.installerIsBrowser = !!aApp.installerIsBrowser;
aObj.storeId = aApp.storeId || "";
aObj.storeVersion = aApp.storeVersion || 0;
aObj.role = aApp.role || "";
aObj.kind = aApp.kind;
aObj.enabled = aApp.enabled !== undefined ? aApp.enabled : true;
aObj.sideloaded = aApp.sideloaded;
aObj.extensionVersion = aApp.extensionVersion;
aObj.blockedStatus =
aApp.blockedStatus !== undefined ? aApp.blockedStatus
: Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
aObj.blocklistId = aApp.blocklistId;
}
this.AppsUtils = {
// Clones a app, without the manifest.
cloneAppObject: function(aApp) {
let obj = {};
_setAppProperties(obj, aApp);
return obj;
},
// Creates a nsILoadContext object with a given appId and inIsolatedMozBrowser
// flag.
createLoadContext: function createLoadContext(aAppId, aInIsolatedMozBrowser) {
return {
associatedWindow: null,
topWindow : null,
appId: aAppId,
isInIsolatedMozBrowserElement: aInIsolatedMozBrowser,
originAttributes: {
appId: aAppId,
inIsolatedMozBrowser: aInIsolatedMozBrowser
},
usePrivateBrowsing: false,
isContent: false,
QueryInterface: XPCOMUtils.generateQI([Ci.nsILoadContext,
Ci.nsIInterfaceRequestor,
Ci.nsISupports]),
getInterface: function(iid) {
if (iid.equals(Ci.nsILoadContext))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
}
}
},
// Sends data downloaded from aRequestChannel to a file
// identified by aId and aFileName.
getFile: function(aRequestChannel, aId, aFileName) {
let deferred = Promise.defer();
// Staging the file in TmpD until all the checks are done.
let file = FileUtils.getFile("TmpD", ["webapps", aId, aFileName], true);
// We need an output stream to write the channel content to the out file.
let outputStream = Cc["@mozilla.org/network/file-output-stream;1"]
.createInstance(Ci.nsIFileOutputStream);
// write, create, truncate
outputStream.init(file, 0x02 | 0x08 | 0x20, parseInt("0664", 8), 0);
let bufferedOutputStream =
Cc['@mozilla.org/network/buffered-output-stream;1']
.createInstance(Ci.nsIBufferedOutputStream);
bufferedOutputStream.init(outputStream, 1024);
// Create a listener that will give data to the file output stream.
let listener = Cc["@mozilla.org/network/simple-stream-listener;1"]
.createInstance(Ci.nsISimpleStreamListener);
listener.init(bufferedOutputStream, {
onStartRequest: function(aRequest, aContext) {
// Nothing to do there anymore.
},
onStopRequest: function(aRequest, aContext, aStatusCode) {
bufferedOutputStream.close();
outputStream.close();
if (!Components.isSuccessCode(aStatusCode)) {
deferred.reject({ msg: "NETWORK_ERROR", downloadAvailable: true});
return;
}
// If we get a 4XX or a 5XX http status, bail out like if we had a
// network error.
let responseStatus = aRequestChannel.responseStatus;
if (responseStatus >= 400 && responseStatus <= 599) {
// unrecoverable error, don't bug the user
deferred.reject({ msg: "NETWORK_ERROR", downloadAvailable: false});
return;
}
deferred.resolve(file);
}
});
aRequestChannel.asyncOpen2(listener);
return deferred.promise;
},
// Eliminate query and hash string.
getFilePath: function(aPagePath) {
let urlParser = Cc["@mozilla.org/network/url-parser;1?auth=no"]
.getService(Ci.nsIURLParser);
let uriData = [aPagePath, aPagePath.length, {}, {}, {}, {}, {}, {}];
urlParser.parsePath.apply(urlParser, uriData);
let [{value: pathPos}, {value: pathLen}] = uriData.slice(2, 4);
return aPagePath.substr(pathPos, pathLen);
},
getManifestFor: function getManifestFor(aManifestURL) {
debug("getManifestFor(" + aManifestURL + ")");
return DOMApplicationRegistry.getManifestFor(aManifestURL);
},
getAppLocalIdByManifestURL: function getAppLocalIdByManifestURL(aApps, aManifestURL) {
debug("getAppLocalIdByManifestURL " + aManifestURL);
for (let id in aApps) {
if (aApps[id].manifestURL == aManifestURL) {
return aApps[id].localId;
}
}
return Ci.nsIScriptSecurityManager.NO_APP_ID;
},
getAppLocalIdByStoreId: function(aApps, aStoreId) {
debug("getAppLocalIdByStoreId:" + aStoreId);
for (let id in aApps) {
if (aApps[id].storeId == aStoreId) {
return aApps[id].localId;
}
}
return Ci.nsIScriptSecurityManager.NO_APP_ID;
},
getManifestURLByLocalId: function getManifestURLByLocalId(aApps, aLocalId) {
debug("getManifestURLByLocalId " + aLocalId);
for (let id in aApps) {
let app = aApps[id];
if (app.localId == aLocalId) {
return app.manifestURL;
}
}
return "";
},
areAnyAppsInstalled: function(aApps) {
return Object.getOwnPropertyNames(aApps).length > 0;
},
getCoreAppsBasePath: function getCoreAppsBasePath() {
debug("getCoreAppsBasePath()");
try {
return FileUtils.getDir("coreAppsDir", ["webapps"], false).path;
} catch(e) {
return null;
}
},
getAppInfo: function getAppInfo(aApps, aAppId) {
let app = aApps[aAppId];
if (!app) {
debug("No webapp for " + aAppId);
return null;
}
// We can have 3rd party apps that are non-removable,
// so we can't use the 'removable' property for isCoreApp
// Instead, we check if the app is installed under /system/b2g
let isCoreApp = false;
#ifdef MOZ_WIDGET_GONK
isCoreApp = app.basePath == this.getCoreAppsBasePath();
#endif
debug(app.basePath + " isCoreApp: " + isCoreApp);
return { "path": app.basePath + "/" + app.id,
"isCoreApp": isCoreApp };
},
/**
* Remove potential HTML tags from displayable fields in the manifest.
* We check name, description, developer name, and permission description
*/
sanitizeManifest: function(aManifest) {
let sanitizer = Cc["@mozilla.org/parserutils;1"]
.getService(Ci.nsIParserUtils);
if (!sanitizer) {
return;
}
function sanitize(aStr) {
return sanitizer.convertToPlainText(aStr,
Ci.nsIDocumentEncoder.OutputRaw, 0);
}
function sanitizeEntryPoint(aRoot) {
aRoot.name = sanitize(aRoot.name);
if (aRoot.description) {
aRoot.description = sanitize(aRoot.description);
}
if (aRoot.developer && aRoot.developer.name) {
aRoot.developer.name = sanitize(aRoot.developer.name);
}
if (aRoot.permissions) {
for (let permission in aRoot.permissions) {
if (aRoot.permissions[permission].description) {
aRoot.permissions[permission].description =
sanitize(aRoot.permissions[permission].description);
}
}
}
}
// First process the main section, then the entry points.
sanitizeEntryPoint(aManifest);
if (aManifest.entry_points) {
for (let entry in aManifest.entry_points) {
sanitizeEntryPoint(aManifest.entry_points[entry]);
}
}
},
/**
* From https://developer.mozilla.org/en/OpenWebApps/The_Manifest
* Only the name property is mandatory.
*/
checkManifest: function(aManifest, app) {
if (aManifest.name == undefined)
return false;
this.sanitizeManifest(aManifest);
// launch_path, entry_points launch paths, message hrefs, and activity hrefs can't be absolute
if (aManifest.launch_path && isAbsoluteURI(aManifest.launch_path))
return false;
function checkAbsoluteEntryPoints(entryPoints) {
for (let name in entryPoints) {
if (entryPoints[name].launch_path && isAbsoluteURI(entryPoints[name].launch_path)) {
return true;
}
}
return false;
}
if (checkAbsoluteEntryPoints(aManifest.entry_points))
return false;
for (let localeName in aManifest.locales) {
if (checkAbsoluteEntryPoints(aManifest.locales[localeName].entry_points)) {
return false;
}
}
if (aManifest.activities) {
for (let activityName in aManifest.activities) {
let activity = aManifest.activities[activityName];
if (activity.href && isAbsoluteURI(activity.href)) {
return false;
}
}
}
// |messages| is an array of items, where each item is either a string or
// a {name: href} object.
let messages = aManifest.messages;
if (messages) {
if (!Array.isArray(messages)) {
return false;
}
for (let item of aManifest.messages) {
if (typeof item == "object") {
let keys = Object.keys(item);
if (keys.length != 1) {
return false;
}
if (isAbsoluteURI(item[keys[0]])) {
return false;
}
}
}
}
// The 'size' field must be a positive integer.
if (aManifest.size) {
aManifest.size = parseInt(aManifest.size);
if (Number.isNaN(aManifest.size) || aManifest.size < 0) {
return false;
}
}
// The 'role' field must be a string.
if (aManifest.role && (typeof aManifest.role !== "string")) {
return false;
}
return true;
},
checkManifestContentType: function
checkManifestContentType(aInstallOrigin, aWebappOrigin, aContentType) {
let hadCharset = { };
let charset = { };
let netutil = Cc["@mozilla.org/network/util;1"].getService(Ci.nsINetUtil);
let contentType = netutil.parseResponseContentType(aContentType, charset, hadCharset);
if (aInstallOrigin != aWebappOrigin &&
!(contentType == "application/x-web-app-manifest+json" ||
contentType == "application/manifest+json")) {
return false;
}
return true;
},
allowUnsignedAddons: false, // for testing purposes.
/**
* Checks if the app role is allowed:
* Only certified apps can be themes.
* Only privileged or certified apps can be addons.
* @param aRole : the role assigned to this app.
* @param aStatus : the APP_STATUS_* for this app.
*/
checkAppRole: function(aRole, aStatus) {
try {
// Anything is possible in developer mode.
if (Services.prefs.getBoolPref("dom.apps.developer_mode")) {
return true;
}
} catch(e) {}
if (aRole == "theme" && aStatus !== Ci.nsIPrincipal.APP_STATUS_CERTIFIED) {
return false;
}
if (!this.allowUnsignedAddons &&
(aRole == "addon" &&
aStatus !== Ci.nsIPrincipal.APP_STATUS_CERTIFIED &&
aStatus !== Ci.nsIPrincipal.APP_STATUS_PRIVILEGED)) {
return false;
}
return true;
},
/**
* Method to apply modifications to webapp manifests file saved internally.
* For now, only ensure app can't rename itself.
*/
ensureSameAppName: function ensureSameAppName(aOldManifest, aNewManifest, aApp) {
// Ensure that app name can't be updated
aNewManifest.name = aApp.name;
let defaultShortName =
new ManifestHelper(aOldManifest, aApp.origin, aApp.manifestURL).short_name;
aNewManifest.short_name = defaultShortName;
// Nor through localized names
if ("locales" in aNewManifest) {
for (let locale in aNewManifest.locales) {
let newLocaleEntry = aNewManifest.locales[locale];
let oldLocaleEntry = aOldManifest && "locales" in aOldManifest &&
locale in aOldManifest.locales && aOldManifest.locales[locale];
if (newLocaleEntry.name) {
// In case previous manifest didn't had a name,
// we use the default app name
newLocaleEntry.name =
(oldLocaleEntry && oldLocaleEntry.name) || aApp.name;
}
if (newLocaleEntry.short_name) {
newLocaleEntry.short_name =
(oldLocaleEntry && oldLocaleEntry.short_name) || defaultShortName;
}
}
}
},
/**
* Determines whether the manifest allows installs for the given origin.
* @param object aManifest
* @param string aInstallOrigin
* @return boolean
**/
checkInstallAllowed: function checkInstallAllowed(aManifest, aInstallOrigin) {
if (!aManifest.installs_allowed_from) {
return true;
}
function cbCheckAllowedOrigin(aOrigin) {
return aOrigin == "*" || aOrigin == aInstallOrigin;
}
return aManifest.installs_allowed_from.some(cbCheckAllowedOrigin);
},
/**
* Determine the type of app (app, privileged, certified)
* that is installed by the manifest
* @param object aManifest
* @returns integer
**/
getAppManifestStatus: function getAppManifestStatus(aManifest) {
let type = aManifest.type || "web";
switch(type) {
case "web":
return Ci.nsIPrincipal.APP_STATUS_INSTALLED;
case "privileged":
return Ci.nsIPrincipal.APP_STATUS_PRIVILEGED;
case "certified":
return Ci.nsIPrincipal.APP_STATUS_CERTIFIED;
default:
throw new Error("Webapps.jsm: Undetermined app manifest type");
}
},
/**
* Check if two manifests have the same set of properties and that the
* values of these properties are the same, in each locale.
* Manifests here are raw json ones.
*/
compareManifests: function compareManifests(aManifest1, aManifest2) {
// 1. check if we have the same locales in both manifests.
let locales1 = [];
let locales2 = [];
if (aManifest1.locales) {
for (let locale in aManifest1.locales) {
locales1.push(locale);
}
}
if (aManifest2.locales) {
for (let locale in aManifest2.locales) {
locales2.push(locale);
}
}
if (locales1.sort().join() !== locales2.sort().join()) {
return false;
}
// Helper function to check the app name and developer information for
// two given roots.
let checkNameAndDev = function(aRoot1, aRoot2) {
let name1 = aRoot1.name;
let name2 = aRoot2.name;
if (name1 !== name2) {
return false;
}
let dev1 = aRoot1.developer;
let dev2 = aRoot2.developer;
if ((dev1 && !dev2) || (dev2 && !dev1)) {
return false;
}
return (!dev1 && !dev2) ||
(dev1.name === dev2.name && dev1.url === dev2.url);
}
// 2. For each locale, check if the name and dev info are the same.
if (!checkNameAndDev(aManifest1, aManifest2)) {
return false;
}
for (let locale in aManifest1.locales) {
if (!checkNameAndDev(aManifest1.locales[locale],
aManifest2.locales[locale])) {
return false;
}
}
// Nothing failed.
return true;
},
// Asynchronously loads a JSON file. aPath is a string representing the path
// of the file to be read.
loadJSONAsync: function(aPath) {
let deferred = Promise.defer();
try {
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
file.initWithPath(aPath);
let channel = NetUtil.newChannel({
uri: NetUtil.newURI(file),
loadUsingSystemPrincipal: true});
channel.contentType = "application/json";
NetUtil.asyncFetch(channel, function(aStream, aResult) {
if (!Components.isSuccessCode(aResult)) {
deferred.resolve(null);
if (aResult == Cr.NS_ERROR_FILE_NOT_FOUND) {
// We expect this under certain circumstances, like for webapps.json
// on firstrun, so we return early without reporting an error.
return;
}
Cu.reportError("AppsUtils: Could not read from json file " + aPath);
return;
}
try {
// Obtain a converter to read from a UTF-8 encoded input stream.
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
// Read json file into a string
let data = JSON.parse(converter.ConvertToUnicode(NetUtil.readInputStreamToString(aStream,
aStream.available()) || ""));
aStream.close();
deferred.resolve(data);
} catch (ex) {
Cu.reportError("AppsUtils: Could not parse JSON: " +
aPath + " " + ex + "\n" + ex.stack);
deferred.resolve(null);
}
});
} catch (ex) {
Cu.reportError("AppsUtils: Could not read from " +
aPath + " : " + ex + "\n" + ex.stack);
deferred.resolve(null);
}
return deferred.promise;
},
// Returns the hash of a string, with MD5 as a default hashing function.
computeHash: function(aString, aAlgorithm = "MD5") {
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
let result = {};
// Data is an array of bytes.
let data = converter.convertToByteArray(aString, result);
let hasher = Cc["@mozilla.org/security/hash;1"]
.createInstance(Ci.nsICryptoHash);
hasher.initWithString(aAlgorithm);
hasher.update(data, data.length);
// We're passing false to get the binary hash and not base64.
let hash = hasher.finish(false);
function toHexString(charCode) {
return ("0" + charCode.toString(16)).slice(-2);
}
// Convert the binary hash data to a hex string.
return Array.from(hash, (c, i) => toHexString(hash.charCodeAt(i))).join("");
},
// Returns the hash for a JS object.
computeObjectHash: function(aObject) {
return this.computeHash(JSON.stringify(aObject));
},
}
/**
* Helper object to access manifest information with locale support
*/
this.ManifestHelper = function(aManifest, aOrigin, aManifestURL, aLang) {
// If the app is packaged, we resolve uris against the origin.
// If it's not, against the manifest url.
if (!aOrigin || !aManifestURL) {
throw Error("ManifestHelper needs both origin and manifestURL");
}
this._baseURI = Services.io.newURI(
aOrigin.startsWith("app://") ? aOrigin : aManifestURL, null, null);
// We keep the manifest url in all cases since we need it to
// resolve the package path for packaged apps.
this._manifestURL = Services.io.newURI(aManifestURL, null, null);
this._manifest = aManifest;
let locale = aLang;
if (!locale) {
let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry)
.QueryInterface(Ci.nsIToolkitChromeRegistry);
locale = chrome.getSelectedLocale("global").toLowerCase();
}
this._localeRoot = this._manifest;
if (this._manifest.locales && this._manifest.locales[locale]) {
this._localeRoot = this._manifest.locales[locale];
}
else if (this._manifest.locales) {
// try with the language part of the locale ("en" for en-GB) only
let lang = locale.split('-')[0];
if (lang != locale && this._manifest.locales[lang])
this._localeRoot = this._manifest.locales[lang];
}
};
ManifestHelper.prototype = {
_localeProp: function(aProp) {
if (this._localeRoot[aProp] != undefined)
return this._localeRoot[aProp];
return (aProp in this._manifest) ? this._manifest[aProp] : undefined;
},
get name() {
return this._localeProp("name");
},
get short_name() {
return this._localeProp("short_name");
},
get description() {
return this._localeProp("description");
},
get type() {
return this._localeProp("type");
},
get version() {
return this._localeProp("version");
},
get launch_path() {
return this._localeProp("launch_path");
},
get developer() {
// Default to {} in order to avoid exception in code
// that doesn't check for null `developer`
return this._localeProp("developer") || {};
},
get icons() {
return this._localeProp("icons");
},
get appcache_path() {
return this._localeProp("appcache_path");
},
get orientation() {
return this._localeProp("orientation");
},
get package_path() {
return this._localeProp("package_path");
},
get size() {
return this._manifest["size"] || 0;
},
get permissions() {
if (this._manifest.permissions) {
return this._manifest.permissions;
}
return {};
},
biggestIconURL: function(predicate) {
let icons = this._localeProp("icons");
if (!icons) {
return null;
}
let iconSizes = Object.keys(icons).sort((a, b) => a - b)
.filter(predicate || (() => true));
if (iconSizes.length == 0) {
return null;
}
let biggestIconSize = iconSizes.pop();
let biggestIcon = icons[biggestIconSize];
let biggestIconURL = this._baseURI.resolve(biggestIcon);
return biggestIconURL;
},
iconURLForSize: function(aSize) {
let icons = this._localeProp("icons");
if (!icons)
return null;
let dist = 100000;
let icon = null;
for (let size in icons) {
let iSize = parseInt(size);
if (Math.abs(iSize - aSize) < dist) {
icon = this._baseURI.resolve(icons[size]);
dist = Math.abs(iSize - aSize);
}
}
return icon;
},
fullLaunchPath: function(aStartPoint) {
// If no start point is specified, we use the root launch path.
// In all error cases, we just return null.
if ((aStartPoint || "") === "") {
// W3C start_url takes precedence over mozApps launch_path
if (this._localeProp("start_url")) {
return this._baseURI.resolve(this._localeProp("start_url") || "/");
}
return this._baseURI.resolve(this._localeProp("launch_path") || "/");
}
// Search for the l10n entry_points property.
let entryPoints = this._localeProp("entry_points");
if (!entryPoints) {
return null;
}
if (entryPoints[aStartPoint]) {
return this._baseURI.resolve(entryPoints[aStartPoint].launch_path || "/");
}
return null;
},
resolveURL: function(aURI) {
// This should be enforced higher up, but check it here just in case.
if (isAbsoluteURI(aURI)) {
throw new Error("Webapps.jsm: non-relative URI passed to resolve");
}
return this._baseURI.resolve(aURI);
},
fullAppcachePath: function() {
let appcachePath = this._localeProp("appcache_path");
return this._baseURI.resolve(appcachePath ? appcachePath : "/");
},
fullPackagePath: function() {
let packagePath = this._localeProp("package_path");
return this._manifestURL.resolve(packagePath ? packagePath : "/");
},
get role() {
return this._manifest.role || "";
},
get csp() {
return this._manifest.csp || "";
}
}

Просмотреть файл

@ -4,12 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
EXTRA_JS_MODULES += [
'PermissionsTable.jsm',
]
EXTRA_PP_JS_MODULES += [
'AppsUtils.jsm',
]

Просмотреть файл

@ -1,23 +0,0 @@
// Test that W3C start_url takes precedence over mozApps launch_path
function run_test() {
Components.utils.import("resource:///modules/AppsUtils.jsm");
let manifest1 = {
launch_path: "other.html"
};
let manifest2 = {
start_url: "start.html",
launch_path: "other.html"
};
var helper = new ManifestHelper(manifest1, "http://foo.com",
"http://foo.com/manifest.json");
var path = helper.fullLaunchPath();
do_check_true(path == "http://foo.com/other.html");
helper = new ManifestHelper(manifest2, "http://foo.com",
"http://foo.com/manifest.json");
path = helper.fullLaunchPath();
do_check_true(path == "http://foo.com/start.html");
}

Просмотреть файл

@ -1,63 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function testEntryPoint(aRoot) {
do_check_true(aRoot.name == "hello world");
do_check_true(aRoot.description == "A bold name");
do_check_true(aRoot.developer.name == "Blink Inc.");
let permissions = aRoot.permissions;
do_check_true(permissions.contacts.description == "Required for autocompletion in the share screen");
do_check_true(permissions.alarms.description == "Required to schedule notifications");
}
function run_test() {
Components.utils.import("resource:///modules/AppsUtils.jsm");
do_check_true(!!AppsUtils);
// Test manifest, with one entry point.
let manifest = {
name: "hello <b>world</b>",
description: "A bold name",
developer: {
name: "<blink>Blink</blink> Inc.",
url: "http://blink.org"
},
permissions : {
"contacts": {
"description": "Required for autocompletion in the <a href='http://shareme.com'>share</a> screen",
"access": "readcreate"
},
"alarms": {
"description": "Required to schedule notifications"
}
},
entry_points: {
"subapp": {
name: "hello <b>world</b>",
description: "A bold name",
developer: {
name: "<blink>Blink</blink> Inc.",
url: "http://blink.org"
},
permissions : {
"contacts": {
"description": "Required for autocompletion in the <a href='http://shareme.com'>share</a> screen",
"access": "readcreate"
},
"alarms": {
"description": "Required to schedule notifications"
}
}
}
}
}
AppsUtils.sanitizeManifest(manifest);
// Check the main section and the subapp entry point.
testEntryPoint(manifest);
testEntryPoint(manifest.entry_points.subapp);
}

Просмотреть файл

@ -1,4 +0,0 @@
[DEFAULT]
[test_manifestSanitizer.js]
[test_manifestHelper.js]

Просмотреть файл

@ -7,6 +7,8 @@
#ifndef CORSMode_h_
#define CORSMode_h_
#include <stdint.h>
namespace mozilla {
enum CORSMode : uint8_t {

92
dom/base/Dispatcher.cpp Normal file
Просмотреть файл

@ -0,0 +1,92 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/Dispatcher.h"
#include "mozilla/Move.h"
using namespace mozilla;
nsresult
DispatcherTrait::Dispatch(const char* aName,
TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable)
{
return NS_DispatchToMainThread(Move(aRunnable));
}
already_AddRefed<nsIEventTarget>
DispatcherTrait::CreateEventTarget(const char* aName,
TaskCategory aCategory)
{
nsCOMPtr<nsIEventTarget> main = do_GetMainThread();
return main.forget();
}
namespace {
class DispatcherEventTarget final : public nsIEventTarget
{
RefPtr<dom::Dispatcher> mDispatcher;
const char* mName;
TaskCategory mCategory;
public:
DispatcherEventTarget(dom::Dispatcher* aDispatcher,
const char* aName,
TaskCategory aCategory)
: mDispatcher(aDispatcher)
, mName(aName)
, mCategory(aCategory)
{}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIEVENTTARGET
dom::Dispatcher* Dispatcher() const { return mDispatcher; }
private:
virtual ~DispatcherEventTarget() {}
};
} // namespace
NS_IMPL_ISUPPORTS(DispatcherEventTarget, nsIEventTarget)
NS_IMETHODIMP
DispatcherEventTarget::DispatchFromScript(nsIRunnable* aRunnable, uint32_t aFlags)
{
return Dispatch(do_AddRef(aRunnable), aFlags);
}
NS_IMETHODIMP
DispatcherEventTarget::Dispatch(already_AddRefed<nsIRunnable> aRunnable, uint32_t aFlags)
{
if (NS_WARN_IF(aFlags != NS_DISPATCH_NORMAL)) {
return NS_ERROR_UNEXPECTED;
}
return mDispatcher->Dispatch(mName, mCategory, Move(aRunnable));
}
NS_IMETHODIMP
DispatcherEventTarget::DelayedDispatch(already_AddRefed<nsIRunnable>, uint32_t)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
DispatcherEventTarget::IsOnCurrentThread(bool* aIsOnCurrentThread)
{
*aIsOnCurrentThread = NS_IsMainThread();
return NS_OK;
}
already_AddRefed<nsIEventTarget>
Dispatcher::CreateEventTarget(const char* aName, TaskCategory aCategory)
{
RefPtr<DispatcherEventTarget> target =
new DispatcherEventTarget(this, aName, aCategory);
return target.forget();
}

75
dom/base/Dispatcher.h Normal file
Просмотреть файл

@ -0,0 +1,75 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_Dispatcher_h
#define mozilla_dom_Dispatcher_h
#include "mozilla/AlreadyAddRefed.h"
#include "nsISupports.h"
class nsIEventTarget;
class nsIRunnable;
namespace mozilla {
namespace dom {
enum class TaskCategory {
// User input (clicks, keypresses, etc.)
UI,
// Data from the network
Network,
// setTimeout, setInterval
Timer,
// requestIdleCallback
IdleCallback,
// Vsync notifications
RefreshDriver,
// Most DOM events (postMessage, media, plugins)
Other,
};
// This trait should be attached to classes like nsIGlobalObject and nsIDocument
// that have a DocGroup or TabGroup attached to them. The methods here should
// delegate to the DocGroup or TabGroup. We can't use the Dispatcher class
// directly because it inherits from nsISupports.
class DispatcherTrait {
public:
// This method may or may not be safe off of the main thread. For nsIDocument
// it is safe. For nsIGlobalWindow it is not safe.
virtual nsresult Dispatch(const char* aName,
TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable);
// This method may or may not be safe off of the main thread. For nsIDocument
// it is safe. For nsIGlobalWindow it is not safe. The nsIEventTarget can
// always be used off the main thread.
virtual already_AddRefed<nsIEventTarget>
CreateEventTarget(const char* aName, TaskCategory aCategory);
};
// Base class for DocGroup and TabGroup.
class Dispatcher : public nsISupports {
public:
// This method is always safe to call off the main thread.
virtual nsresult Dispatch(const char* aName,
TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable) = 0;
// This method is always safe to call off the main thread. The nsIEventTarget
// can always be used off the main thread.
virtual already_AddRefed<nsIEventTarget>
CreateEventTarget(const char* aName, TaskCategory aCategory);
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_Dispatcher_h

Просмотреть файл

@ -1,11 +1,15 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/Telemetry.h"
#include "nsIURI.h"
#include "nsIEffectiveTLDService.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/ClearOnShutdown.h"
#include "nsIDocShell.h"
#include "nsIEffectiveTLDService.h"
#include "nsIURI.h"
namespace mozilla {
namespace dom {
@ -51,5 +55,13 @@ DocGroup::~DocGroup()
NS_IMPL_ISUPPORTS(DocGroup, nsISupports)
nsresult
DocGroup::Dispatch(const char* aName,
TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable)
{
return NS_DispatchToMainThread(Move(aRunnable));
}
}
}

Просмотреть файл

@ -13,6 +13,7 @@
#include "nsTHashtable.h"
#include "nsString.h"
#include "mozilla/dom/Dispatcher.h"
#include "mozilla/RefPtr.h"
namespace mozilla {
@ -35,7 +36,7 @@ namespace dom {
class TabGroup;
class DocGroup final : public nsISupports
class DocGroup final : public Dispatcher
{
public:
typedef nsTArray<nsIDocument*>::iterator Iterator;
@ -64,6 +65,10 @@ public:
return mDocuments.end();
}
virtual nsresult Dispatch(const char* aName,
TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable) override;
private:
DocGroup(TabGroup* aTabGroup, const nsACString& aKey);
~DocGroup();

Просмотреть файл

@ -36,20 +36,6 @@ DocumentFragment::IsNodeOfType(uint32_t aFlags) const
return !(aFlags & ~(eCONTENT | eDOCUMENT_FRAGMENT));
}
NS_IMETHODIMP
DocumentFragment::QuerySelector(const nsAString& aSelector,
nsIDOMElement **aReturn)
{
return nsINode::QuerySelector(aSelector, aReturn);
}
NS_IMETHODIMP
DocumentFragment::QuerySelectorAll(const nsAString& aSelector,
nsIDOMNodeList **aReturn)
{
return nsINode::QuerySelectorAll(aSelector, aReturn);
}
#ifdef DEBUG
void
DocumentFragment::List(FILE* out, int32_t aIndent) const

Просмотреть файл

@ -132,13 +132,6 @@ DocumentType::GetInternalSubset(nsAString& aInternalSubset)
return NS_OK;
}
NS_IMETHODIMP
DocumentType::MozRemove()
{
Remove();
return NS_OK;
}
nsGenericDOMDataNode*
DocumentType::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo, bool aCloneText) const
{

Просмотреть файл

@ -3313,14 +3313,6 @@ Element::AttrValueToCORSMode(const nsAttrValue* aValue)
static const char*
GetFullScreenError(nsIDocument* aDoc)
{
if (aDoc->NodePrincipal()->GetAppStatus() >= nsIPrincipal::APP_STATUS_INSTALLED) {
// Request is in a web app and in the same origin as the web app.
// Don't enforce as strict security checks for web apps, the user
// is supposed to have trust in them. However documents cross-origin
// to the web app must still confirm to the normal security checks.
return nullptr;
}
if (!nsContentUtils::IsRequestFullScreenAllowed()) {
return "FullscreenDeniedNotInputDriven";
}
@ -3329,7 +3321,7 @@ GetFullScreenError(nsIDocument* aDoc)
}
void
Element::RequestFullscreen(ErrorResult& aError)
Element::RequestFullscreen(CallerType aCallerType, ErrorResult& aError)
{
// Only grant full-screen requests if this is called from inside a trusted
// event handler (i.e. inside an event handler for a user initiated event).
@ -3344,15 +3336,15 @@ Element::RequestFullscreen(ErrorResult& aError)
}
auto request = MakeUnique<FullscreenRequest>(this);
request->mIsCallerChrome = nsContentUtils::IsCallerChrome();
request->mIsCallerChrome = (aCallerType == CallerType::System);
OwnerDoc()->AsyncRequestFullScreen(Move(request));
}
void
Element::RequestPointerLock()
Element::RequestPointerLock(CallerType aCallerType)
{
OwnerDoc()->RequestPointerLock(this);
OwnerDoc()->RequestPointerLock(this, aCallerType);
}
void

Просмотреть файл

@ -65,6 +65,7 @@ namespace dom {
class DOMIntersectionObserver;
class ElementOrCSSPseudoElement;
class UnrestrictedDoubleOrKeyframeAnimationOptions;
enum class CallerType : uint32_t;
} // namespace dom
} // namespace mozilla
@ -788,8 +789,8 @@ public:
}
}
void RequestFullscreen(ErrorResult& aError);
void RequestPointerLock();
void RequestFullscreen(CallerType aCallerType, ErrorResult& aError);
void RequestPointerLock(CallerType aCallerType);
Attr* GetAttributeNode(const nsAString& aName);
already_AddRefed<Attr> SetAttributeNode(Attr& aNewAttr,
ErrorResult& aError);
@ -1745,171 +1746,5 @@ NS_IMETHOD GetElementsByClassName(const nsAString& classes, \
override \
{ \
return Element::GetElementsByClassName(classes, _retval); \
} \
NS_IMETHOD GetChildElements(nsIDOMNodeList** aChildElements) final override \
{ \
nsIHTMLCollection* list = FragmentOrElement::Children(); \
return CallQueryInterface(list, aChildElements); \
} \
NS_IMETHOD GetFirstElementChild(nsIDOMElement** aFirstElementChild) final \
override \
{ \
Element* element = Element::GetFirstElementChild(); \
if (!element) { \
*aFirstElementChild = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aFirstElementChild); \
} \
NS_IMETHOD GetLastElementChild(nsIDOMElement** aLastElementChild) final \
override \
{ \
Element* element = Element::GetLastElementChild(); \
if (!element) { \
*aLastElementChild = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aLastElementChild); \
} \
NS_IMETHOD GetPreviousElementSibling(nsIDOMElement** aPreviousElementSibling) \
final override \
{ \
Element* element = Element::GetPreviousElementSibling(); \
if (!element) { \
*aPreviousElementSibling = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aPreviousElementSibling); \
} \
NS_IMETHOD GetNextElementSibling(nsIDOMElement** aNextElementSibling) \
final override \
{ \
Element* element = Element::GetNextElementSibling(); \
if (!element) { \
*aNextElementSibling = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aNextElementSibling); \
} \
NS_IMETHOD GetChildElementCount(uint32_t* aChildElementCount) final override \
{ \
*aChildElementCount = Element::ChildElementCount(); \
return NS_OK; \
} \
NS_IMETHOD MozRemove() final override \
{ \
nsINode::Remove(); \
return NS_OK; \
} \
NS_IMETHOD GetClientRects(nsIDOMClientRectList** _retval) final override \
{ \
*_retval = Element::GetClientRects().take(); \
return NS_OK; \
} \
NS_IMETHOD GetBoundingClientRect(nsIDOMClientRect** _retval) final override \
{ \
*_retval = Element::GetBoundingClientRect().take(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollTop(int32_t* aScrollTop) final override \
{ \
*aScrollTop = Element::ScrollTop(); \
return NS_OK; \
} \
NS_IMETHOD SetScrollTop(int32_t aScrollTop) final override \
{ \
Element::SetScrollTop(aScrollTop); \
return NS_OK; \
} \
NS_IMETHOD GetScrollLeft(int32_t* aScrollLeft) final override \
{ \
*aScrollLeft = Element::ScrollLeft(); \
return NS_OK; \
} \
NS_IMETHOD SetScrollLeft(int32_t aScrollLeft) final override \
{ \
Element::SetScrollLeft(aScrollLeft); \
return NS_OK; \
} \
NS_IMETHOD GetScrollWidth(int32_t* aScrollWidth) final override \
{ \
*aScrollWidth = Element::ScrollWidth(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollHeight(int32_t* aScrollHeight) final override \
{ \
*aScrollHeight = Element::ScrollHeight(); \
return NS_OK; \
} \
NS_IMETHOD GetClientTop(int32_t* aClientTop) final override \
{ \
*aClientTop = Element::ClientTop(); \
return NS_OK; \
} \
NS_IMETHOD GetClientLeft(int32_t* aClientLeft) final override \
{ \
*aClientLeft = Element::ClientLeft(); \
return NS_OK; \
} \
NS_IMETHOD GetClientWidth(int32_t* aClientWidth) final override \
{ \
*aClientWidth = Element::ClientWidth(); \
return NS_OK; \
} \
NS_IMETHOD GetClientHeight(int32_t* aClientHeight) final override \
{ \
*aClientHeight = Element::ClientHeight(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollLeftMax(int32_t* aScrollLeftMax) final override \
{ \
*aScrollLeftMax = Element::ScrollLeftMax(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollTopMax(int32_t* aScrollTopMax) final override \
{ \
*aScrollTopMax = Element::ScrollTopMax(); \
return NS_OK; \
} \
NS_IMETHOD MozMatchesSelector(const nsAString& selector, \
bool* _retval) final override \
{ \
mozilla::ErrorResult rv; \
*_retval = Element::Matches(selector, rv); \
return rv.StealNSResult(); \
} \
NS_IMETHOD SetCapture(bool retargetToElement) final override \
{ \
Element::SetCapture(retargetToElement); \
return NS_OK; \
} \
NS_IMETHOD ReleaseCapture(void) final override \
{ \
Element::ReleaseCapture(); \
return NS_OK; \
} \
NS_IMETHOD MozRequestFullScreen(void) final override \
{ \
mozilla::ErrorResult rv; \
Element::RequestFullscreen(rv); \
return rv.StealNSResult(); \
} \
NS_IMETHOD MozRequestPointerLock(void) final override \
{ \
Element::RequestPointerLock(); \
return NS_OK; \
} \
using nsINode::QuerySelector; \
NS_IMETHOD QuerySelector(const nsAString& aSelector, \
nsIDOMElement **aReturn) final override \
{ \
return nsINode::QuerySelector(aSelector, aReturn); \
} \
using nsINode::QuerySelectorAll; \
NS_IMETHOD QuerySelectorAll(const nsAString& aSelector, \
nsIDOMNodeList **aReturn) final override \
{ \
return nsINode::QuerySelectorAll(aSelector, aReturn); \
}
#endif // mozilla_dom_Element_h__

Просмотреть файл

@ -6,7 +6,6 @@
#include "mozilla/HoldDropJSObjects.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/PoseBinding.h"
#include "mozilla/dom/Pose.h"
namespace mozilla {
@ -84,11 +83,5 @@ Pose::SetFloat32Array(JSContext* aJSContext, JS::MutableHandle<JSObject*> aRetVa
aRetVal.set(aObj);
}
/* virtual */ JSObject*
Pose::WrapObject(JSContext* aJSContext, JS::Handle<JSObject*> aGivenProto)
{
return PoseBinding::Wrap(aJSContext, this, aGivenProto);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -41,9 +41,6 @@ public:
JS::MutableHandle<JSObject*> aRetval,
ErrorResult& aRv) = 0;
virtual JSObject* WrapObject(JSContext* aJSContext,
JS::Handle<JSObject*> aGivenProto) override;
protected:
virtual ~Pose();

Просмотреть файл

@ -478,12 +478,6 @@ ScreenOrientation::GetLockOrientationPermission(bool aCheckSandbox) const
return LOCK_DENIED;
}
// Apps can always lock the screen orientation.
if (doc->NodePrincipal()->GetAppStatus() >=
nsIPrincipal::APP_STATUS_INSTALLED) {
return LOCK_ALLOWED;
}
if (Preferences::GetBool("dom.screenorientation.testing.non_fullscreen_lock_allow",
false)) {
return LOCK_ALLOWED;

Просмотреть файл

@ -166,5 +166,13 @@ TabGroup::HashEntry::HashEntry(const nsACString* aKey)
: nsCStringHashKey(aKey), mDocGroup(nullptr)
{}
nsresult
TabGroup::Dispatch(const char* aName,
TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable)
{
return NS_DispatchToMainThread(Move(aRunnable));
}
}
}

Просмотреть файл

@ -13,6 +13,7 @@
#include "nsTHashtable.h"
#include "nsString.h"
#include "mozilla/dom/Dispatcher.h"
#include "mozilla/RefPtr.h"
namespace mozilla {
@ -36,7 +37,7 @@ namespace dom {
class DocGroup;
class TabGroup final : public nsISupports
class TabGroup final : public Dispatcher
{
private:
class HashEntry : public nsCStringHashKey
@ -105,6 +106,10 @@ public:
ThrottledEventQueue*
GetThrottledEventQueue() const;
virtual nsresult Dispatch(const char* aName,
TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable) override;
private:
~TabGroup();
DocGroupMap mDocGroups;

Просмотреть файл

@ -14,6 +14,7 @@
#include "nsPIDOMWindow.h"
class nsGlobalWindow;
class nsIEventTarget;
class nsIPrincipal;
class nsITimeoutHandler;
class nsITimer;

Просмотреть файл

@ -160,6 +160,7 @@ EXPORTS.mozilla.dom += [
'Comment.h',
'CustomElementRegistry.h',
'DirectionalityUtils.h',
'Dispatcher.h',
'DocGroup.h',
'DocumentFragment.h',
'DocumentType.h',
@ -235,6 +236,7 @@ UNIFIED_SOURCES += [
'Crypto.cpp',
'CustomElementRegistry.cpp',
'DirectionalityUtils.cpp',
'Dispatcher.cpp',
'DocGroup.cpp',
'DocumentFragment.cpp',
'DocumentType.cpp',

Просмотреть файл

@ -530,10 +530,6 @@ nsDOMWindowUtils::SetDisplayPortBaseForElement(int32_t aX,
NS_IMETHODIMP
nsDOMWindowUtils::SetResolution(float aResolution)
{
if (!nsContentUtils::LegacyIsCallerChromeOrNativeCode()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsIPresShell* presShell = GetPresShell();
if (!presShell) {
return NS_ERROR_FAILURE;
@ -601,10 +597,6 @@ nsDOMWindowUtils::GetIsResolutionSet(bool* aIsResolutionSet) {
NS_IMETHODIMP
nsDOMWindowUtils::SetIsFirstPaint(bool aIsFirstPaint)
{
if (!nsContentUtils::LegacyIsCallerChromeOrNativeCode()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsIPresShell* presShell = GetPresShell();
if (presShell) {
presShell->SetIsFirstPaint(aIsFirstPaint);
@ -616,10 +608,6 @@ nsDOMWindowUtils::SetIsFirstPaint(bool aIsFirstPaint)
NS_IMETHODIMP
nsDOMWindowUtils::GetIsFirstPaint(bool *aIsFirstPaint)
{
if (!nsContentUtils::LegacyIsCallerChromeOrNativeCode()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsIPresShell* presShell = GetPresShell();
if (presShell) {
*aIsFirstPaint = presShell->GetIsFirstPaint();
@ -3005,10 +2993,6 @@ nsDOMWindowUtils::EnableDialogs()
NS_IMETHODIMP
nsDOMWindowUtils::DisableDialogs()
{
if (!nsContentUtils::IsCallerChrome()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
@ -3019,10 +3003,6 @@ nsDOMWindowUtils::DisableDialogs()
NS_IMETHODIMP
nsDOMWindowUtils::AreDialogsEnabled(bool* aResult)
{
if (!nsContentUtils::IsCallerChrome()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
@ -3774,10 +3754,6 @@ NS_IMETHODIMP
nsDOMWindowUtils::SetHandlingUserInput(bool aHandlingUserInput,
nsIJSRAIIHelper** aHelper)
{
if (!nsContentUtils::IsCallerChrome()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
RefPtr<HandlingUserInputHelper> helper(
new HandlingUserInputHelper(aHandlingUserInput));
helper.forget(aHelper);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше