зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to graphics
MozReview-Commit-ID: Oh14EA4ip9
This commit is contained in:
Коммит
fe1bb32f1a
|
@ -63,7 +63,7 @@ protected:
|
|||
virtual ~HTMLLIAccessible() { }
|
||||
|
||||
private:
|
||||
RefPtr<HTMLListBulletAccessible> mBullet;
|
||||
HTMLListBulletAccessible* mBullet;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ interface IGeckoCustom : IUnknown
|
|||
{
|
||||
[propget] HRESULT ID([out, retval] unsigned __int64* aID);
|
||||
[propget] HRESULT anchorCount([out, retval] long* aCount);
|
||||
[propget] HRESULT DOMNodeID([out, retval] BSTR* aID);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -706,5 +706,23 @@ ProxyAccessible::AnchorAt(uint32_t aIdx)
|
|||
return proxyAnchor;
|
||||
}
|
||||
|
||||
void
|
||||
ProxyAccessible::DOMNodeID(nsString& aID)
|
||||
{
|
||||
aID.Truncate();
|
||||
RefPtr<IGeckoCustom> custom = QueryInterface<IGeckoCustom>(this);
|
||||
if (!custom) {
|
||||
return;
|
||||
}
|
||||
|
||||
BSTR result;
|
||||
HRESULT hr = custom->get_DOMNodeID(&result);
|
||||
_bstr_t resultWrap(result, false);
|
||||
if (FAILED(hr)) {
|
||||
return;
|
||||
}
|
||||
aID = (wchar_t*)resultWrap;
|
||||
}
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -20,6 +20,23 @@ GeckoCustom::get_anchorCount(long* aCount)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
GeckoCustom::get_DOMNodeID(BSTR* aID)
|
||||
{
|
||||
nsIContent* content = mAcc->GetContent();
|
||||
if (!content) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
nsIAtom* id = content->GetID();
|
||||
if (id) {
|
||||
nsAutoString idStr;
|
||||
id->ToString(idStr);
|
||||
*aID = ::SysAllocStringLen(idStr.get(), idStr.Length());
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
GeckoCustom::get_ID(uint64_t* aID)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
DECL_IUNKNOWN
|
||||
|
||||
virtual STDMETHODIMP get_anchorCount(long* aCount);
|
||||
virtual STDMETHODIMP get_DOMNodeID(BSTR* aID);
|
||||
virtual STDMETHODIMP get_ID(uint64_t* aID);
|
||||
|
||||
private:
|
||||
|
|
|
@ -195,9 +195,6 @@ xpcAccessible::GetDOMNode(nsIDOMNode** aDOMNode)
|
|||
NS_IMETHODIMP
|
||||
xpcAccessible::GetId(nsAString& aID)
|
||||
{
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
ProxyAccessible* proxy = IntlGeneric().AsProxy();
|
||||
if (!proxy) {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -208,7 +205,6 @@ xpcAccessible::GetId(nsAString& aID)
|
|||
aID.Assign(id);
|
||||
|
||||
return NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -116,7 +116,7 @@ function startup(data, reasonCode) {
|
|||
replace(uuidRe, '$1');
|
||||
|
||||
let prefixURI = 'resource://' + domain + '/';
|
||||
let resourcesURI = ioService.newURI(rootURI + '/resources/', null, null);
|
||||
let resourcesURI = ioService.newURI(rootURI + '/resources/');
|
||||
setResourceSubstitution(domain, resourcesURI);
|
||||
|
||||
// Create path to URLs mapping supported by loader.
|
||||
|
@ -179,7 +179,7 @@ function startup(data, reasonCode) {
|
|||
|
||||
// Maps the given file:// URI to a resource:// in order to avoid various
|
||||
// failure that happens with file:// URI and be close to production env
|
||||
let resourcesURI = ioService.newURI(fileURI, null, null);
|
||||
let resourcesURI = ioService.newURI(fileURI);
|
||||
let resName = 'extensions.modules.' + domain + '.commonjs.path' + name;
|
||||
setResourceSubstitution(resName, resourcesURI);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ const registerSDKURI = () => {
|
|||
.QueryInterface(Ci.nsIResProtocolHandler);
|
||||
|
||||
const uri = module.uri.replace("dev/toolbox.js", "");
|
||||
resourceHandler.setSubstitution("sdk", ioService.newURI(uri, null, null));
|
||||
resourceHandler.setSubstitution("sdk", ioService.newURI(uri));
|
||||
};
|
||||
|
||||
registerSDKURI();
|
||||
|
|
|
@ -28,9 +28,8 @@ var sanitizeId = function(id){
|
|||
const PSEUDOURI = "indexeddb://" + sanitizeId(id) // https://bugzilla.mozilla.org/show_bug.cgi?id=779197
|
||||
|
||||
// Use XPCOM because `require("./url").URL` doesn't expose the raw uri object.
|
||||
var principaluri = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService).
|
||||
newURI(PSEUDOURI, null, null);
|
||||
var principaluri = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService).newURI(PSEUDOURI);
|
||||
|
||||
var ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(Ci.nsIScriptSecurityManager);
|
||||
|
|
|
@ -280,7 +280,7 @@ function getPotentialLeaks() {
|
|||
|
||||
let ioService = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
let uri = ioService.newURI("chrome://global/content/", "UTF-8", null);
|
||||
let uri = ioService.newURI("chrome://global/content/", "UTF-8");
|
||||
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].
|
||||
getService(Ci.nsIChromeRegistry);
|
||||
uri = chromeReg.convertChromeURL(uri);
|
||||
|
|
|
@ -17,7 +17,7 @@ const URI = (uri, base=null) =>
|
|||
ioService.newURI(uri, null, base && URI(base))
|
||||
|
||||
const mount = (domain, uri) =>
|
||||
resourceHandler.setSubstitution(domain, ioService.newURI(uri, null, null));
|
||||
resourceHandler.setSubstitution(domain, ioService.newURI(uri));
|
||||
exports.mount = mount;
|
||||
|
||||
const unmount = (domain, uri) =>
|
||||
|
|
|
@ -27,7 +27,7 @@ const { Services } = Cu.import("resource://gre/modules/Services.jsm");
|
|||
|
||||
function newURI(uriStr, base) {
|
||||
try {
|
||||
let baseURI = base ? ios.newURI(base, null, null) : null;
|
||||
let baseURI = base ? ios.newURI(base) : null;
|
||||
return ios.newURI(uriStr, null, baseURI);
|
||||
}
|
||||
catch (e) {
|
||||
|
|
|
@ -17,7 +17,7 @@ const { method } = require("../../method/core");
|
|||
function newURI (uri) {
|
||||
if (!isValidURI(uri))
|
||||
throw new Error("malformed URI: " + uri);
|
||||
return IOService.newURI(uri, null, null);
|
||||
return IOService.newURI(uri);
|
||||
}
|
||||
exports.newURI = newURI;
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ function open(uri, options) {
|
|||
if (!uri)
|
||||
throw new Error('browser.chromeURL is undefined, please provide an explicit uri');
|
||||
|
||||
if (['chrome', 'resource', 'data'].indexOf(io.newURI(uri, null, null).scheme) < 0)
|
||||
if (['chrome', 'resource', 'data'].indexOf(io.newURI(uri).scheme) < 0)
|
||||
throw new Error('only chrome, resource and data uris are allowed');
|
||||
|
||||
let newWindow = windowWatcher.
|
||||
|
|
|
@ -1646,7 +1646,7 @@ RequestReader.prototype =
|
|||
{
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService)
|
||||
.newURI(fullPath, null, null);
|
||||
.newURI(fullPath);
|
||||
fullPath = uri.path;
|
||||
scheme = uri.scheme;
|
||||
host = metadata._host = uri.asciiHost;
|
||||
|
|
|
@ -1646,7 +1646,7 @@ RequestReader.prototype =
|
|||
{
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService)
|
||||
.newURI(fullPath, null, null);
|
||||
.newURI(fullPath);
|
||||
fullPath = uri.path;
|
||||
scheme = uri.scheme;
|
||||
host = metadata._host = uri.asciiHost;
|
||||
|
|
|
@ -1647,7 +1647,7 @@ RequestReader.prototype =
|
|||
{
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService)
|
||||
.newURI(fullPath, null, null);
|
||||
.newURI(fullPath);
|
||||
fullPath = uri.path;
|
||||
scheme = uri.scheme;
|
||||
host = metadata._host = uri.asciiHost;
|
||||
|
|
|
@ -106,7 +106,7 @@ function startup(data, reasonCode) {
|
|||
replace(uuidRe, '$1');
|
||||
|
||||
let prefixURI = 'resource://' + domain + '/';
|
||||
let resourcesURI = ioService.newURI(rootURI + '/resources/', null, null);
|
||||
let resourcesURI = ioService.newURI(rootURI + '/resources/');
|
||||
resourceHandler.setSubstitution(domain, resourcesURI);
|
||||
|
||||
// Create path to URLs mapping supported by loader.
|
||||
|
@ -169,7 +169,7 @@ function startup(data, reasonCode) {
|
|||
|
||||
// Maps the given file:// URI to a resource:// in order to avoid various
|
||||
// failure that happens with file:// URI and be close to production env
|
||||
let resourcesURI = ioService.newURI(fileURI, null, null);
|
||||
let resourcesURI = ioService.newURI(fileURI);
|
||||
let resName = 'extensions.modules.' + domain + '.commonjs.path' + name;
|
||||
resourceHandler.setSubstitution(resName, resourcesURI);
|
||||
|
||||
|
|
|
@ -1646,7 +1646,7 @@ RequestReader.prototype =
|
|||
{
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService)
|
||||
.newURI(fullPath, null, null);
|
||||
.newURI(fullPath);
|
||||
fullPath = uri.path;
|
||||
scheme = uri.scheme;
|
||||
host = metadata._host = uri.asciiHost;
|
||||
|
|
|
@ -106,7 +106,7 @@ function startup(data, reasonCode) {
|
|||
replace(uuidRe, '$1');
|
||||
|
||||
let prefixURI = 'resource://' + domain + '/';
|
||||
let resourcesURI = ioService.newURI(rootURI + '/resources/', null, null);
|
||||
let resourcesURI = ioService.newURI(rootURI + '/resources/');
|
||||
resourceHandler.setSubstitution(domain, resourcesURI);
|
||||
|
||||
// Create path to URLs mapping supported by loader.
|
||||
|
@ -169,7 +169,7 @@ function startup(data, reasonCode) {
|
|||
|
||||
// Maps the given file:// URI to a resource:// in order to avoid various
|
||||
// failure that happens with file:// URI and be close to production env
|
||||
let resourcesURI = ioService.newURI(fileURI, null, null);
|
||||
let resourcesURI = ioService.newURI(fileURI);
|
||||
let resName = 'extensions.modules.' + domain + '.commonjs.path' + name;
|
||||
resourceHandler.setSubstitution(resName, resourcesURI);
|
||||
|
||||
|
|
|
@ -1647,7 +1647,7 @@ RequestReader.prototype =
|
|||
{
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService)
|
||||
.newURI(fullPath, null, null);
|
||||
.newURI(fullPath);
|
||||
fullPath = uri.path;
|
||||
scheme = uri.scheme;
|
||||
host = metadata._host = uri.asciiHost;
|
||||
|
|
|
@ -147,7 +147,7 @@ exports["test handle nsIObserverService notifications"] = function(assert) {
|
|||
let ios = Cc['@mozilla.org/network/io-service;1']
|
||||
.getService(Ci.nsIIOService);
|
||||
|
||||
let uri = ios.newURI("http://www.foo.com", null, null);
|
||||
let uri = ios.newURI("http://www.foo.com");
|
||||
|
||||
let type = Date.now().toString(32);
|
||||
let timesCalled = 0;
|
||||
|
@ -211,7 +211,7 @@ exports["test emit to nsIObserverService observers"] = function(assert) {
|
|||
let ios = Cc['@mozilla.org/network/io-service;1']
|
||||
.getService(Ci.nsIIOService);
|
||||
|
||||
let uri = ios.newURI("http://www.foo.com", null, null);
|
||||
let uri = ios.newURI("http://www.foo.com");
|
||||
let timesCalled = 0;
|
||||
let lastSubject = null;
|
||||
let lastData = null;
|
||||
|
|
|
@ -10,7 +10,7 @@ const { on, off } = require("sdk/system/events");
|
|||
function throwNsIException() {
|
||||
var ios = Cc['@mozilla.org/network/io-service;1']
|
||||
.getService(Ci.nsIIOService);
|
||||
ios.newURI("i'm a malformed URI", null, null);
|
||||
ios.newURI("i'm a malformed URI");
|
||||
}
|
||||
|
||||
function throwError() {
|
||||
|
|
|
@ -141,8 +141,7 @@ function testRegister(assert, text) {
|
|||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
|
||||
var uri = ios.newURI("data:text/plain;charset=utf-8," + text,
|
||||
null, null);
|
||||
var uri = ios.newURI("data:text/plain;charset=utf-8," + text);
|
||||
var channel = ios.newChannelFromURIWithLoadInfo(uri, aLoadInfo);
|
||||
|
||||
channel.originalURI = aURI;
|
||||
|
@ -164,7 +163,7 @@ function testRegister(assert, text) {
|
|||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
assert.equal(
|
||||
about.getURIFlags(ios.newURI("http://foo.com", null, null)),
|
||||
about.getURIFlags(ios.newURI("http://foo.com")),
|
||||
Ci.nsIAboutModule.ALLOW_SCRIPT
|
||||
);
|
||||
|
||||
|
|
|
@ -607,9 +607,7 @@ var shell = {
|
|||
Services.perms.addFromPrincipal(principal, 'offline-app',
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
|
||||
let documentURI = Services.io.newURI(contentWindow.document.documentURI,
|
||||
null,
|
||||
null);
|
||||
let documentURI = Services.io.newURI(contentWindow.document.documentURI);
|
||||
let manifestURI = Services.io.newURI(manifest, null, documentURI);
|
||||
let updateService = Cc['@mozilla.org/offlinecacheupdate-service;1']
|
||||
.getService(Ci.nsIOfflineCacheUpdateService);
|
||||
|
@ -819,16 +817,16 @@ var CustomEventManager = {
|
|||
'ask-children-to-execute-copypaste-command', detail.cmd);
|
||||
break;
|
||||
case 'add-permission':
|
||||
Services.perms.add(Services.io.newURI(detail.uri, null, null),
|
||||
Services.perms.add(Services.io.newURI(detail.uri),
|
||||
detail.permissionType, permissionMap.get(detail.permission));
|
||||
break;
|
||||
case 'remove-permission':
|
||||
Services.perms.remove(Services.io.newURI(detail.uri, null, null),
|
||||
Services.perms.remove(Services.io.newURI(detail.uri),
|
||||
detail.permissionType);
|
||||
break;
|
||||
case 'test-permission':
|
||||
let result = Services.perms.testExactPermission(
|
||||
Services.io.newURI(detail.uri, null, null), detail.permissionType);
|
||||
Services.io.newURI(detail.uri), detail.permissionType);
|
||||
// Not equal check here because we want to prevent default only if it's not set
|
||||
if (result !== permissionMapRev.get(detail.permission)) {
|
||||
evt.preventDefault();
|
||||
|
|
|
@ -20,7 +20,7 @@ var remoteShell = {
|
|||
_started: false,
|
||||
|
||||
get homeURL() {
|
||||
let systemAppManifestURL = Services.io.newURI(this.systemAppManifestURL, null, null);
|
||||
let systemAppManifestURL = Services.io.newURI(this.systemAppManifestURL);
|
||||
let shellRemoteURL = Services.prefs.getCharPref("b2g.multiscreen.system_remote_url");
|
||||
shellRemoteURL = Services.io.newURI(shellRemoteURL, null, systemAppManifestURL);
|
||||
return shellRemoteURL.spec;
|
||||
|
|
|
@ -151,7 +151,7 @@ this.AboutServiceWorkers = {
|
|||
|
||||
let principal = Services.scriptSecurityManager.createCodebasePrincipal(
|
||||
// TODO: Bug 1196652. use originNoSuffix
|
||||
Services.io.newURI(message.principal.origin, null, null),
|
||||
Services.io.newURI(message.principal.origin),
|
||||
message.principal.originAttributes);
|
||||
|
||||
if (!message.scope) {
|
||||
|
|
|
@ -13,7 +13,7 @@ function debug(msg) {
|
|||
|
||||
function netErrorURL() {
|
||||
let systemManifestURL = Services.prefs.getCharPref("b2g.system_manifest_url");
|
||||
systemManifestURL = Services.io.newURI(systemManifestURL, null, null);
|
||||
systemManifestURL = Services.io.newURI(systemManifestURL);
|
||||
let netErrorURL = Services.prefs.getCharPref("b2g.neterror.url");
|
||||
netErrorURL = Services.io.newURI(netErrorURL, null, systemManifestURL);
|
||||
return netErrorURL.spec;
|
||||
|
@ -58,7 +58,7 @@ B2GAboutRedirector.prototype = {
|
|||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
|
||||
var newURI = ios.newURI(moduleInfo.uri, null, null);
|
||||
var newURI = ios.newURI(moduleInfo.uri);
|
||||
|
||||
var channel = ios.newChannelFromURIWithLoadInfo(newURI, aLoadInfo);
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ var ErrorPage = {
|
|||
let win = frameLoaderOwner.ownerDocument.defaultView;
|
||||
let mm = frameLoaderOwner.frameLoader.messageManager;
|
||||
|
||||
let uri = Services.io.newURI(aMessage.data.url, null, null);
|
||||
let uri = Services.io.newURI(aMessage.data.url);
|
||||
let sslExceptions = new SSLExceptions((function() {
|
||||
mm.sendAsyncMessage('ErrorPage:ReloadPage');
|
||||
}).bind(this), uri, win);
|
||||
|
|
|
@ -71,7 +71,7 @@ this.SafeMode = {
|
|||
let document = SafeMode.window.document;
|
||||
SafeMode.window.screen.mozLockOrientation("portrait");
|
||||
|
||||
let url = Services.io.newURI(shell.homeURL, null, null)
|
||||
let url = Services.io.newURI(shell.homeURL)
|
||||
.resolve(kSafeModePage);
|
||||
debug("Registry is ready, loading " + url);
|
||||
let frame = document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
|
||||
|
|
|
@ -28,7 +28,7 @@ var healthReportWrapper = {
|
|||
|
||||
_getReportURI() {
|
||||
let url = Services.urlFormatter.formatURLPref(PREF_REPORTING_URL);
|
||||
return Services.io.newURI(url, null, null);
|
||||
return Services.io.newURI(url);
|
||||
},
|
||||
|
||||
setDataSubmission(enabled) {
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* 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";
|
||||
|
||||
var gEMEHandler = {
|
||||
get uiEnabled() {
|
||||
let emeUIEnabled = Services.prefs.getBoolPref("browser.eme.ui.enabled");
|
||||
|
@ -201,17 +203,10 @@ let gDecoderDoctorHandler = {
|
|||
getLabelForNotificationBox(type) {
|
||||
if (type == "adobe-cdm-not-found" &&
|
||||
AppConstants.platform == "win") {
|
||||
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
|
||||
// We supply our own Learn More button so we don't need to populate the message here.
|
||||
return gNavigatorBundle.getFormattedString("emeNotifications.drmContentDisabled.message", [""]);
|
||||
}
|
||||
return gNavigatorBundle.getString("decoder.noCodecs.message");
|
||||
}
|
||||
if (type == "adobe-cdm-not-activated" &&
|
||||
AppConstants.platform == "win") {
|
||||
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
|
||||
return gNavigatorBundle.getString("decoder.noCodecsXP.message");
|
||||
}
|
||||
if (!AppConstants.isPlatformAndVersionAtLeast("win", "6.1")) {
|
||||
return gNavigatorBundle.getString("decoder.noCodecsVista.message");
|
||||
}
|
||||
|
|
|
@ -394,7 +394,7 @@ SocialShare = {
|
|||
// define at least url. If it is undefined, we're sharing the current url in
|
||||
// the browser tab.
|
||||
let pageData = graphData ? graphData : this.currentShare;
|
||||
let sharedURI = pageData ? Services.io.newURI(pageData.url, null, null) :
|
||||
let sharedURI = pageData ? Services.io.newURI(pageData.url) :
|
||||
gBrowser.currentURI;
|
||||
if (!SocialUI.canSharePage(sharedURI))
|
||||
return;
|
||||
|
@ -474,7 +474,7 @@ SocialShare = {
|
|||
iframe.purgeSessionHistory();
|
||||
|
||||
// always ensure that origin belongs to the endpoint
|
||||
let uri = Services.io.newURI(shareEndpoint, null, null);
|
||||
let uri = Services.io.newURI(shareEndpoint);
|
||||
iframe.setAttribute("origin", provider.origin);
|
||||
iframe.setAttribute("src", shareEndpoint);
|
||||
this._openPanel(anchor);
|
||||
|
|
|
@ -141,8 +141,7 @@ var TrackingProtection = {
|
|||
// nsChannelClassifier::ShouldEnableTrackingProtection.
|
||||
// Any scheme turned into https is correct.
|
||||
let normalizedUrl = Services.io.newURI(
|
||||
"https://" + gBrowser.selectedBrowser.currentURI.hostPort,
|
||||
null, null);
|
||||
"https://" + gBrowser.selectedBrowser.currentURI.hostPort);
|
||||
|
||||
// Add the current host in the 'trackingprotection' consumer of
|
||||
// the permission manager using a normalized URI. This effectively
|
||||
|
@ -168,8 +167,7 @@ var TrackingProtection = {
|
|||
// of the permission manager. This effectively removes this host
|
||||
// from the tracking protection allowlist.
|
||||
let normalizedUrl = Services.io.newURI(
|
||||
"https://" + gBrowser.selectedBrowser.currentURI.hostPort,
|
||||
null, null);
|
||||
"https://" + gBrowser.selectedBrowser.currentURI.hostPort);
|
||||
|
||||
if (PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser)) {
|
||||
PrivateBrowsingUtils.removeFromTrackingAllowlist(normalizedUrl);
|
||||
|
|
|
@ -3275,7 +3275,7 @@ function getDetailedCertErrorInfo(location, securityInfo) {
|
|||
let flags = PrivateBrowsingUtils.isWindowPrivate(window) ?
|
||||
Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0;
|
||||
|
||||
let uri = Services.io.newURI(location, null, null);
|
||||
let uri = Services.io.newURI(location);
|
||||
|
||||
let hasHSTS = sss.isSecureHost(sss.HEADER_HSTS, uri.host, flags);
|
||||
let hasHPKP = sss.isSecureHost(sss.HEADER_HPKP, uri.host, flags);
|
||||
|
@ -6045,7 +6045,7 @@ var OfflineApps = {
|
|||
|
||||
let usage = 0;
|
||||
for (let group of groups) {
|
||||
let uri = Services.io.newURI(group, null, null);
|
||||
let uri = Services.io.newURI(group);
|
||||
if (uri.asciiHost == host) {
|
||||
let cache = cacheService.getActiveCache(group);
|
||||
usage += cache.usage;
|
||||
|
@ -6605,11 +6605,6 @@ var gIdentityHandler = {
|
|||
*/
|
||||
_state: 0,
|
||||
|
||||
/**
|
||||
* Whether a permission is just removed from permission list.
|
||||
*/
|
||||
_permissionJustRemoved: false,
|
||||
|
||||
get _isBroken() {
|
||||
return this._state & Ci.nsIWebProgressListener.STATE_IS_BROKEN;
|
||||
},
|
||||
|
@ -7304,6 +7299,9 @@ var gIdentityHandler = {
|
|||
// the popup is actually needed
|
||||
this._identityPopup.hidden = false;
|
||||
|
||||
// Remove the reload hint that we show after a user has cleared a permission.
|
||||
this._permissionReloadHint.setAttribute("hidden", "true");
|
||||
|
||||
// Update the popup strings
|
||||
this.refreshIdentityPopup();
|
||||
|
||||
|
@ -7364,21 +7362,10 @@ var gIdentityHandler = {
|
|||
},
|
||||
|
||||
onLocationChange() {
|
||||
this._permissionJustRemoved = false;
|
||||
this.updatePermissionHint();
|
||||
},
|
||||
this._permissionReloadHint.setAttribute("hidden", "true");
|
||||
|
||||
updatePermissionHint() {
|
||||
if (!this._permissionList.hasChildNodes() && !this._permissionJustRemoved) {
|
||||
if (!this._permissionList.hasChildNodes()) {
|
||||
this._permissionEmptyHint.removeAttribute("hidden");
|
||||
} else {
|
||||
this._permissionEmptyHint.setAttribute("hidden", "true");
|
||||
}
|
||||
|
||||
if (this._permissionJustRemoved) {
|
||||
this._permissionReloadHint.removeAttribute("hidden");
|
||||
} else {
|
||||
this._permissionReloadHint.setAttribute("hidden", "true");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -7418,7 +7405,13 @@ var gIdentityHandler = {
|
|||
this._permissionList.appendChild(item);
|
||||
}
|
||||
|
||||
this.updatePermissionHint();
|
||||
// Show a placeholder text if there's no permission and no reload hint.
|
||||
if (!this._permissionList.hasChildNodes() &&
|
||||
this._permissionReloadHint.hasAttribute("hidden")) {
|
||||
this._permissionEmptyHint.removeAttribute("hidden");
|
||||
} else {
|
||||
this._permissionEmptyHint.setAttribute("hidden", "true");
|
||||
}
|
||||
},
|
||||
|
||||
_handleHeightChange(aFunction, aWillShowReloadHint) {
|
||||
|
@ -7464,8 +7457,9 @@ var gIdentityHandler = {
|
|||
let tooltiptext = gNavigatorBundle.getString("permissions.remove.tooltip");
|
||||
button.setAttribute("tooltiptext", tooltiptext);
|
||||
button.addEventListener("command", () => {
|
||||
this._handleHeightChange(() =>
|
||||
this._permissionList.removeChild(container), !this._permissionJustRemoved);
|
||||
// Only resize the window if the reload hint was previously hidden.
|
||||
this._handleHeightChange(() => this._permissionList.removeChild(container),
|
||||
this._permissionReloadHint.hasAttribute("hidden"));
|
||||
if (aPermission.inUse &&
|
||||
["camera", "microphone", "screen"].includes(aPermission.id)) {
|
||||
let windowId = this._sharingState.windowId;
|
||||
|
@ -7490,8 +7484,8 @@ var gIdentityHandler = {
|
|||
mm.sendAsyncMessage("webrtc:StopSharing", windowId);
|
||||
}
|
||||
SitePermissions.remove(gBrowser.currentURI, aPermission.id);
|
||||
this._permissionJustRemoved = true;
|
||||
this.updatePermissionHint();
|
||||
|
||||
this._permissionReloadHint.removeAttribute("hidden");
|
||||
|
||||
// Set telemetry values for clearing a permission
|
||||
let histogram = Services.telemetry.getKeyedHistogramById("WEB_PERMISSION_CLEARED");
|
||||
|
@ -7716,7 +7710,7 @@ function switchToTabHavingURI(aURI, aOpenNew, aOpenParams = {}) {
|
|||
|
||||
// This can be passed either nsIURI or a string.
|
||||
if (!(aURI instanceof Ci.nsIURI))
|
||||
aURI = Services.io.newURI(aURI, null, null);
|
||||
aURI = Services.io.newURI(aURI);
|
||||
|
||||
let isBrowserWindow = !!window.gBrowser;
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ Site.prototype = {
|
|||
if (this.link.endTime && this.link.endTime < Date.now()) {
|
||||
let oldUrl = this.url;
|
||||
// chop off the path part from url
|
||||
this.link.url = Services.io.newURI(this.url, null, null).resolve("/");
|
||||
this.link.url = Services.io.newURI(this.url).resolve("/");
|
||||
// clear supplied images - this triggers thumbnail download for new url
|
||||
delete this.link.imageURI;
|
||||
delete this.link.enhancedImageURI;
|
||||
|
@ -309,7 +309,7 @@ Site.prototype = {
|
|||
*/
|
||||
_speculativeConnect: function Site_speculativeConnect() {
|
||||
let sc = Services.io.QueryInterface(Ci.nsISpeculativeConnect);
|
||||
let uri = Services.io.newURI(this.url, null, null);
|
||||
let uri = Services.io.newURI(this.url);
|
||||
try {
|
||||
// This can throw for certain internal URLs, when they wind up in
|
||||
// about:newtab. Be sure not to propagate the error.
|
||||
|
|
|
@ -501,7 +501,7 @@ function openCacheEntry(key, cb) {
|
|||
cb(entry);
|
||||
}
|
||||
};
|
||||
diskStorage.asyncOpenURI(Services.io.newURI(key, null, null), "", nsICacheStorage.OPEN_READONLY, checkCacheListener);
|
||||
diskStorage.asyncOpenURI(Services.io.newURI(key), "", nsICacheStorage.OPEN_READONLY, checkCacheListener);
|
||||
}
|
||||
|
||||
function makeGeneralTab(metaViewRows, docInfo) {
|
||||
|
|
|
@ -539,7 +539,7 @@ var PageStyleHandler = {
|
|||
if (!currentStyleSheet.ownerNode ||
|
||||
// special-case style nodes, which have no href
|
||||
currentStyleSheet.ownerNode.nodeName.toLowerCase() != "style") {
|
||||
URI = Services.io.newURI(currentStyleSheet.href, null, null);
|
||||
URI = Services.io.newURI(currentStyleSheet.href);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.result != Cr.NS_ERROR_MALFORMED_URI) {
|
||||
|
|
|
@ -287,7 +287,7 @@ add_task(function* checkAdvancedDetailsForHSTS() {
|
|||
};
|
||||
});
|
||||
|
||||
const badStsUri = Services.io.newURI(BAD_STS_CERT, null, null);
|
||||
const badStsUri = Services.io.newURI(BAD_STS_CERT);
|
||||
is(message.ecTextContent, "SSL_ERROR_BAD_CERT_DOMAIN",
|
||||
"Correct error message found");
|
||||
is(message.ecTagName, "a", "Error message is a link");
|
||||
|
|
|
@ -41,7 +41,7 @@ function test() {
|
|||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref(kpkpEnforcementPref);
|
||||
Services.prefs.clearUserPref(khpkpPinninEnablePref);
|
||||
let uri = gIOService.newURI("https://" + kPinningDomain, null, null);
|
||||
let uri = gIOService.newURI("https://" + kPinningDomain);
|
||||
gSSService.removeState(Ci.nsISiteSecurityService.HEADER_HPKP, uri, 0);
|
||||
});
|
||||
whenNewTabLoaded(window, loadPinningPage);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
function test() {
|
||||
let uriString = "http://example.com/";
|
||||
let cookieBehavior = "network.cookie.cookieBehavior";
|
||||
let uriObj = Services.io.newURI(uriString, null, null)
|
||||
let uriObj = Services.io.newURI(uriString)
|
||||
let cp = Components.classes["@mozilla.org/cookie/permission;1"]
|
||||
.getService(Components.interfaces.nsICookiePermission);
|
||||
|
||||
|
|
|
@ -52,13 +52,7 @@ add_task(function* test_adobe_cdm_not_found() {
|
|||
return;
|
||||
}
|
||||
|
||||
let message;
|
||||
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
|
||||
message = gNavigatorBundle.getFormattedString("emeNotifications.drmContentDisabled.message", [""]);
|
||||
} else {
|
||||
message = gNavigatorBundle.getString("decoder.noCodecs.message");
|
||||
}
|
||||
|
||||
let message = gNavigatorBundle.getString("decoder.noCodecs.message");
|
||||
yield test_decoder_doctor_notification("adobe-cdm-not-found", message);
|
||||
});
|
||||
|
||||
|
@ -68,22 +62,11 @@ add_task(function* test_adobe_cdm_not_activated() {
|
|||
return;
|
||||
}
|
||||
|
||||
let message;
|
||||
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
|
||||
message = gNavigatorBundle.getString("decoder.noCodecsXP.message");
|
||||
} else {
|
||||
message = gNavigatorBundle.getString("decoder.noCodecs.message");
|
||||
}
|
||||
|
||||
let message = gNavigatorBundle.getString("decoder.noCodecs.message");
|
||||
yield test_decoder_doctor_notification("adobe-cdm-not-activated", message);
|
||||
});
|
||||
|
||||
add_task(function* test_platform_decoder_not_found() {
|
||||
// Not sent on Windows XP.
|
||||
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
|
||||
return;
|
||||
}
|
||||
|
||||
let message;
|
||||
let isLinux = AppConstants.platform == "linux";
|
||||
if (isLinux) {
|
||||
|
|
|
@ -86,7 +86,7 @@ var gTests = [
|
|||
|
||||
let promiseEcho = new Promise((resolve, reject) => {
|
||||
|
||||
let webChannelOrigin = Services.io.newURI(properUrl, null, null);
|
||||
let webChannelOrigin = Services.io.newURI(properUrl);
|
||||
// responses sent to content are echoed back over the
|
||||
// `fxaccounts_webchannel_response_echo` channel. Ensure the
|
||||
// fxaccounts:can_link_account message is responded to.
|
||||
|
|
|
@ -7,7 +7,7 @@ const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/te
|
|||
|
||||
registerCleanupFunction(function() {
|
||||
// Clean up after ourself
|
||||
let uri = Services.io.newURI(URL, null, null);
|
||||
let uri = Services.io.newURI(URL);
|
||||
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
|
||||
Services.perms.removeFromPrincipal(principal, "offline-app");
|
||||
Services.prefs.clearUserPref("offline-apps.allow_by_default");
|
||||
|
|
|
@ -10,7 +10,7 @@ const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/of
|
|||
|
||||
registerCleanupFunction(function() {
|
||||
// Clean up after ourself
|
||||
let uri = Services.io.newURI(URL, null, null);
|
||||
let uri = Services.io.newURI(URL);
|
||||
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
|
||||
Services.perms.removeFromPrincipal(principal, "offline-app");
|
||||
Services.prefs.clearUserPref("offline-apps.quota.warn");
|
||||
|
|
|
@ -132,7 +132,7 @@ var gChromeMap = new Map();
|
|||
|
||||
function getBaseUriForChromeUri(chromeUri) {
|
||||
let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere";
|
||||
let uri = Services.io.newURI(chromeFile, null, null);
|
||||
let uri = Services.io.newURI(chromeFile);
|
||||
let fileUri = gChromeReg.convertChromeURL(uri);
|
||||
return fileUri.resolve(".");
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ function convertToChromeUri(fileUri) {
|
|||
if (gChromeMap.has(baseUri)) {
|
||||
let chromeBaseUri = gChromeMap.get(baseUri);
|
||||
let chromeUri = `${chromeBaseUri}${path}`;
|
||||
return Services.io.newURI(chromeUri, null, null);
|
||||
return Services.io.newURI(chromeUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ function processCSSRules(sheet) {
|
|||
continue;
|
||||
|
||||
// Make the url absolute and remove the ref.
|
||||
let baseURI = Services.io.newURI(rule.parentStyleSheet.href, null, null);
|
||||
let baseURI = Services.io.newURI(rule.parentStyleSheet.href);
|
||||
url = Services.io.newURI(url, null, baseURI).specIgnoringRef;
|
||||
|
||||
// Store the image url along with the css file referencing it.
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
var {WebChannel} = Cu.import("resource://gre/modules/WebChannel.jsm", {});
|
||||
|
||||
const TEST_URL_TAIL = "example.com/browser/browser/base/content/test/general/test_remoteTroubleshoot.html"
|
||||
const TEST_URI_GOOD = Services.io.newURI("https://" + TEST_URL_TAIL, null, null);
|
||||
const TEST_URI_BAD = Services.io.newURI("http://" + TEST_URL_TAIL, null, null);
|
||||
const TEST_URI_GOOD_OBJECT = Services.io.newURI("https://" + TEST_URL_TAIL + "?object", null, null);
|
||||
const TEST_URI_GOOD = Services.io.newURI("https://" + TEST_URL_TAIL);
|
||||
const TEST_URI_BAD = Services.io.newURI("http://" + TEST_URL_TAIL);
|
||||
const TEST_URI_GOOD_OBJECT = Services.io.newURI("https://" + TEST_URL_TAIL + "?object");
|
||||
|
||||
// Creates a one-shot web-channel for the test data to be sent back from the test page.
|
||||
function promiseChannelResponse(channelID, originOrPermission) {
|
||||
|
|
|
@ -25,7 +25,7 @@ var gTests = [
|
|||
*run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tab;
|
||||
let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH));
|
||||
channel.listen(function(id, message, target) {
|
||||
is(id, "generic");
|
||||
is(message.something.nested, "hello");
|
||||
|
@ -42,7 +42,7 @@ var gTests = [
|
|||
desc: "WebChannel generic message in a private window.",
|
||||
*run() {
|
||||
let promiseTestDone = new Promise(function(resolve, reject) {
|
||||
let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH));
|
||||
channel.listen(function(id, message, target) {
|
||||
is(id, "generic");
|
||||
is(message.something.nested, "hello");
|
||||
|
@ -63,7 +63,7 @@ var gTests = [
|
|||
*run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tab;
|
||||
let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH));
|
||||
|
||||
channel.listen(function(id, message, sender) {
|
||||
is(id, "twoway", "bad id");
|
||||
|
@ -88,8 +88,8 @@ var gTests = [
|
|||
{
|
||||
desc: "WebChannel two way communication in an iframe",
|
||||
*run() {
|
||||
let parentChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let iframeChannel = new WebChannel("twoway", Services.io.newURI(HTTP_IFRAME_PATH, null, null));
|
||||
let parentChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
|
||||
let iframeChannel = new WebChannel("twoway", Services.io.newURI(HTTP_IFRAME_PATH));
|
||||
let promiseTestDone = new Promise(function(resolve, reject) {
|
||||
parentChannel.listen(function(id, message, sender) {
|
||||
reject(new Error("WebChannel message incorrectly sent to parent"));
|
||||
|
@ -145,8 +145,8 @@ var gTests = [
|
|||
* the message to origin B is, then hooray, the test passes.
|
||||
*/
|
||||
|
||||
let preRedirectChannel = new WebChannel("pre_redirect", Services.io.newURI(HTTP_IFRAME_PATH, null, null));
|
||||
let postRedirectChannel = new WebChannel("post_redirect", Services.io.newURI(HTTP_REDIRECTED_IFRAME_PATH, null, null));
|
||||
let preRedirectChannel = new WebChannel("pre_redirect", Services.io.newURI(HTTP_IFRAME_PATH));
|
||||
let postRedirectChannel = new WebChannel("post_redirect", Services.io.newURI(HTTP_REDIRECTED_IFRAME_PATH));
|
||||
|
||||
let promiseTestDone = new Promise(function(resolve, reject) {
|
||||
preRedirectChannel.listen(function(id, message, preRedirectSender) {
|
||||
|
@ -188,7 +188,7 @@ var gTests = [
|
|||
*run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tab;
|
||||
let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH));
|
||||
|
||||
channel.listen(function(id, message, sender) {
|
||||
is(id, "multichannel");
|
||||
|
@ -203,7 +203,7 @@ var gTests = [
|
|||
{
|
||||
desc: "WebChannel unsolicited send, using system principal",
|
||||
*run() {
|
||||
let channel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
|
||||
|
||||
// an unsolicted message is sent from Chrome->Content which is then
|
||||
// echoed back. If the echo is received here, then the content
|
||||
|
@ -233,7 +233,7 @@ var gTests = [
|
|||
{
|
||||
desc: "WebChannel unsolicited send, using target origin's principal",
|
||||
*run() {
|
||||
let targetURI = Services.io.newURI(HTTP_PATH, null, null);
|
||||
let targetURI = Services.io.newURI(HTTP_PATH);
|
||||
let channel = new WebChannel("echo", targetURI);
|
||||
|
||||
// an unsolicted message is sent from Chrome->Content which is then
|
||||
|
@ -266,7 +266,7 @@ var gTests = [
|
|||
{
|
||||
desc: "WebChannel unsolicited send with principal mismatch",
|
||||
*run() {
|
||||
let targetURI = Services.io.newURI(HTTP_PATH, null, null);
|
||||
let targetURI = Services.io.newURI(HTTP_PATH);
|
||||
let channel = new WebChannel("echo", targetURI);
|
||||
|
||||
// two unsolicited messages are sent from Chrome->Content. The first,
|
||||
|
@ -290,7 +290,7 @@ var gTests = [
|
|||
url: HTTP_PATH + HTTP_ENDPOINT + "?unsolicited"
|
||||
}, function* (targetBrowser) {
|
||||
|
||||
let mismatchURI = Services.io.newURI(HTTP_MISMATCH_PATH, null, null);
|
||||
let mismatchURI = Services.io.newURI(HTTP_MISMATCH_PATH);
|
||||
let mismatchPrincipal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(mismatchURI);
|
||||
|
||||
// send a message to the wrong principal. It should not be delivered
|
||||
|
@ -327,7 +327,7 @@ var gTests = [
|
|||
* receives the message.
|
||||
* Listen for the response. If received, good to go!
|
||||
*/
|
||||
let channel = new WebChannel("not_a_window", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("not_a_window", Services.io.newURI(HTTP_PATH));
|
||||
|
||||
let testDonePromise = new Promise(function(resolve, reject) {
|
||||
channel.listen(function(id, message, sender) {
|
||||
|
@ -360,7 +360,7 @@ var gTests = [
|
|||
* and the second has a string. We check that we only get the second
|
||||
* message.
|
||||
*/
|
||||
let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH));
|
||||
let testDonePromise = new Promise((resolve, reject) => {
|
||||
channel.listen((id, message, sender) => {
|
||||
is(id, "objects");
|
||||
|
@ -384,7 +384,7 @@ var gTests = [
|
|||
* Same process as above, but we whitelist the origin before loading the page,
|
||||
* and expect to get *both* messages back (each exactly once).
|
||||
*/
|
||||
let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH));
|
||||
|
||||
let testDonePromise = new Promise((resolve, reject) => {
|
||||
let sawObject = false;
|
||||
|
@ -425,9 +425,9 @@ var gTests = [
|
|||
const ERRNO_UNKNOWN_ERROR = 999; // WebChannel.jsm doesn't export this.
|
||||
|
||||
// The channel where we purposely fail responding to a command.
|
||||
let channel = new WebChannel("error", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let channel = new WebChannel("error", Services.io.newURI(HTTP_PATH));
|
||||
// The channel where we see the response when the content sees the error
|
||||
let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
|
||||
|
||||
let testDonePromise = new Promise((resolve, reject) => {
|
||||
// listen for the confirmation that content saw the error.
|
||||
|
@ -460,7 +460,7 @@ var gTests = [
|
|||
*run() {
|
||||
const ERRNO_NO_SUCH_CHANNEL = 2; // WebChannel.jsm doesn't export this.
|
||||
// The channel where we see the response when the content sees the error
|
||||
let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
|
||||
let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
|
||||
|
||||
let testDonePromise = new Promise((resolve, reject) => {
|
||||
// listen for the confirmation that content saw the error.
|
||||
|
|
|
@ -68,7 +68,7 @@ function iterateOverPath(path, extensions) {
|
|||
// returned as part of the directory iterator, but don't actually exist:
|
||||
if (file.exists()) {
|
||||
let uriSpec = getURLForFile(file);
|
||||
files.push(Services.io.newURI(uriSpec, null, null));
|
||||
files.push(Services.io.newURI(uriSpec));
|
||||
}
|
||||
} else if (entry.name.endsWith(".ja") || entry.name.endsWith(".jar") ||
|
||||
entry.name.endsWith(".zip") || entry.name.endsWith(".xpi")) {
|
||||
|
@ -123,7 +123,7 @@ function* generateEntriesFromJarFile(jarFile, extension) {
|
|||
continue;
|
||||
}
|
||||
let entryURISpec = "jar:" + kURIStart + "!/" + entry;
|
||||
yield Services.io.newURI(entryURISpec, null, null);
|
||||
yield Services.io.newURI(entryURISpec);
|
||||
}
|
||||
zr.close();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ function promiseObserverNotified(aTopic) {
|
|||
// in history, will not appear in about:newtab or auto-complete, etc.)
|
||||
function promiseSocialUrlNotRemembered(url) {
|
||||
return new Promise(resolve => {
|
||||
let uri = Services.io.newURI(url, null, null);
|
||||
let uri = Services.io.newURI(url);
|
||||
PlacesUtils.asyncHistory.isURIVisited(uri, function(aURI, aIsVisited) {
|
||||
ok(!aIsVisited, "social URL " + url + " should not be in global history");
|
||||
resolve();
|
||||
|
@ -211,7 +211,7 @@ function setManifestPref(name, manifest) {
|
|||
|
||||
function getManifestPrefname(aManifest) {
|
||||
// is same as the generated name in SocialServiceInternal.getManifestPrefname
|
||||
let originUri = Services.io.newURI(aManifest.origin, null, null);
|
||||
let originUri = Services.io.newURI(aManifest.origin);
|
||||
return "social.manifest." + originUri.hostPort.replace('.', '-');
|
||||
}
|
||||
|
||||
|
|
|
@ -7,12 +7,12 @@ const REDIRECT_FROM = "https://example.com/browser/browser/base/content/test/url
|
|||
const REDIRECT_TO = "https://www.bank1.com/"; // Bad-cert host.
|
||||
|
||||
function isRedirectedURISpec(aURISpec) {
|
||||
return isRedirectedURI(Services.io.newURI(aURISpec, null, null));
|
||||
return isRedirectedURI(Services.io.newURI(aURISpec));
|
||||
}
|
||||
|
||||
function isRedirectedURI(aURI) {
|
||||
// Compare only their before-hash portion.
|
||||
return Services.io.newURI(REDIRECT_TO, null, null)
|
||||
return Services.io.newURI(REDIRECT_TO)
|
||||
.equalsExceptRef(aURI);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ var gTests = [
|
|||
yield checkSharingUI({video: true, audio: true});
|
||||
|
||||
let Perms = Services.perms;
|
||||
let uri = Services.io.newURI("https://example.com/", null, null);
|
||||
let uri = Services.io.newURI("https://example.com/");
|
||||
is(Perms.testExactPermission(uri, "microphone"), Perms.ALLOW_ACTION,
|
||||
"microphone persistently allowed");
|
||||
is(Perms.testExactPermission(uri, "camera"), Perms.ALLOW_ACTION,
|
||||
|
|
|
@ -323,7 +323,7 @@ function openLinkIn(url, where, params) {
|
|||
loadInBackground = false;
|
||||
|
||||
try {
|
||||
uriObj = Services.io.newURI(url, null, null);
|
||||
uriObj = Services.io.newURI(url);
|
||||
} catch (e) {}
|
||||
|
||||
if (w.gBrowser.getTabForBrowser(targetBrowser).pinned &&
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(function* () {
|
|||
let contract = "@mozilla.org/network/protocol/about;1?what=" + aboutType;
|
||||
try {
|
||||
let am = Cc[contract].getService(Ci.nsIAboutModule);
|
||||
let uri = ios.newURI("about:" + aboutType, null, null);
|
||||
let uri = ios.newURI("about:" + aboutType);
|
||||
let flags = am.getURIFlags(uri);
|
||||
if (!(flags & Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT) &&
|
||||
networkURLs.indexOf(aboutType) == -1) {
|
||||
|
|
|
@ -74,7 +74,7 @@ function getCookiesForOA(host, userContextId) {
|
|||
function createURI(uri) {
|
||||
let ioServ = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
return ioServ.newURI(uri, null, null);
|
||||
return ioServ.newURI(uri);
|
||||
}
|
||||
|
||||
function getCacheStorage(where, lci, appcache) {
|
||||
|
|
|
@ -97,7 +97,7 @@ DistributionCustomizer.prototype = {
|
|||
},
|
||||
|
||||
_makeURI: function DIST__makeURI(spec) {
|
||||
return this._ioSvc.newURI(spec, null, null);
|
||||
return this._ioSvc.newURI(spec);
|
||||
},
|
||||
|
||||
_parseBookmarksSection: Task.async(function* (parentGuid, section) {
|
||||
|
|
|
@ -197,16 +197,8 @@ this.DownloadsViewUI.DownloadElementShell.prototype = {
|
|||
if (!this.download.stopped) {
|
||||
let totalBytes = this.download.hasProgress ? this.download.totalBytes
|
||||
: -1;
|
||||
// By default, extended status information including the individual
|
||||
// download rate is displayed in the tooltip. The history view overrides
|
||||
// the getter and displays the datails in the main area instead.
|
||||
[text] = DownloadUtils.getDownloadStatusNoRate(
|
||||
this.download.currentBytes,
|
||||
totalBytes,
|
||||
this.download.speed,
|
||||
this.lastEstimatedSecondsLeft);
|
||||
let newEstimatedSecondsLeft;
|
||||
[tip, newEstimatedSecondsLeft] = DownloadUtils.getDownloadStatus(
|
||||
[text, newEstimatedSecondsLeft] = DownloadUtils.getDownloadStatus(
|
||||
this.download.currentBytes,
|
||||
totalBytes,
|
||||
this.download.speed,
|
||||
|
|
|
@ -1215,7 +1215,7 @@ DownloadsPlacesView.prototype = {
|
|||
let [url, name] = data.value.QueryInterface(Ci.nsISupportsString)
|
||||
.data.split("\n");
|
||||
if (url) {
|
||||
return [NetUtil.newURI(url, null, null).spec, name];
|
||||
return [NetUtil.newURI(url).spec, name];
|
||||
}
|
||||
} catch (ex) {}
|
||||
|
||||
|
|
|
@ -502,7 +502,7 @@ MenuItem.prototype = {
|
|||
}
|
||||
|
||||
let docPattern = this.documentUrlMatchPattern;
|
||||
let pageURI = Services.io.newURI(contextData.pageUrl, null, null);
|
||||
let pageURI = Services.io.newURI(contextData.pageUrl);
|
||||
if (docPattern && !docPattern.matches(pageURI)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -703,7 +703,7 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (pattern && !pattern.matches(Services.io.newURI(tab.url, null, null))) {
|
||||
if (pattern && !pattern.matches(Services.io.newURI(tab.url))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ FeedConverter.prototype = {
|
|||
feedService.addFeedResult(result);
|
||||
|
||||
// Now load the actual XUL document.
|
||||
let aboutFeedsURI = ios.newURI("about:feeds", null, null);
|
||||
let aboutFeedsURI = ios.newURI("about:feeds");
|
||||
chromeChannel = ios.newChannelFromURIWithLoadInfo(aboutFeedsURI, loadInfo);
|
||||
chromeChannel.originalURI = result.uri;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ function makeURI(aURLSpec, aCharset) {
|
|||
let ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
try {
|
||||
return ios.newURI(aURLSpec, aCharset, null);
|
||||
return ios.newURI(aURLSpec, aCharset);
|
||||
} catch (ex) { }
|
||||
|
||||
return null;
|
||||
|
|
|
@ -2,13 +2,13 @@ var Cu = Components.utils;
|
|||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
function run_test() {
|
||||
var feedFeedURI = ios.newURI("feed://example.com/feed.xml", null, null);
|
||||
var httpFeedURI = ios.newURI("feed:http://example.com/feed.xml", null, null);
|
||||
var httpURI = ios.newURI("http://example.com/feed.xml", null, null);
|
||||
var feedFeedURI = ios.newURI("feed://example.com/feed.xml");
|
||||
var httpFeedURI = ios.newURI("feed:http://example.com/feed.xml");
|
||||
var httpURI = ios.newURI("http://example.com/feed.xml");
|
||||
|
||||
var httpsFeedURI =
|
||||
ios.newURI("feed:https://example.com/feed.xml", null, null);
|
||||
var httpsURI = ios.newURI("https://example.com/feed.xml", null, null);
|
||||
ios.newURI("feed:https://example.com/feed.xml");
|
||||
var httpsURI = ios.newURI("https://example.com/feed.xml");
|
||||
|
||||
var feedChannel = NetUtil.newChannel({
|
||||
uri: feedFeedURI,
|
||||
|
@ -36,8 +36,8 @@ function run_test() {
|
|||
do_check_true(httpsURI.equals(httpsChannel.URI));
|
||||
|
||||
// check that we throw creating feed: URIs from file and ftp
|
||||
Assert.throws(function() { ios.newURI("feed:ftp://example.com/feed.xml", null, null); },
|
||||
Assert.throws(function() { ios.newURI("feed:ftp://example.com/feed.xml"); },
|
||||
"Should throw an exception when trying to create a feed: URI with an ftp: inner");
|
||||
Assert.throws(function() { ios.newURI("feed:file:///var/feed.xml", null, null); },
|
||||
Assert.throws(function() { ios.newURI("feed:file:///var/feed.xml"); },
|
||||
"Should throw an exception when trying to create a feed: URI with a file: inner");
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function run_test() {
|
||||
var success = false;
|
||||
try {
|
||||
ios.newURI("feed:javascript:alert('hi');", null, null);
|
||||
ios.newURI("feed:javascript:alert('hi');");
|
||||
} catch (e) {
|
||||
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ function run_test() {
|
|||
|
||||
success = false;
|
||||
try {
|
||||
ios.newURI("feed:data:text/html,hi", null, null);
|
||||
ios.newURI("feed:data:text/html,hi");
|
||||
} catch (e) {
|
||||
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ function run_test() {
|
|||
|
||||
success = false;
|
||||
try {
|
||||
ios.newURI("pcast:javascript:alert('hi');", null, null);
|
||||
ios.newURI("pcast:javascript:alert('hi');");
|
||||
} catch (e) {
|
||||
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ function run_test() {
|
|||
|
||||
success = false;
|
||||
try {
|
||||
ios.newURI("pcast:data:text/html,hi", null, null);
|
||||
ios.newURI("pcast:data:text/html,hi");
|
||||
} catch (e) {
|
||||
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ EdgeTypedURLMigrator.prototype = {
|
|||
for (let [urlString, time] of typedURLs) {
|
||||
let uri;
|
||||
try {
|
||||
uri = Services.io.newURI(urlString, null, null);
|
||||
uri = Services.io.newURI(urlString);
|
||||
if (["http", "https", "ftp"].indexOf(uri.scheme) == -1) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -791,7 +791,7 @@ WindowsVaultFormPasswords.prototype = {
|
|||
let url = item.contents.pResourceElement.contents.itemValue.readString();
|
||||
let realURL;
|
||||
try {
|
||||
realURL = Services.io.newURI(url, null, null);
|
||||
realURL = Services.io.newURI(url);
|
||||
} catch (ex) { /* leave realURL as null */ }
|
||||
if (!realURL || ["http", "https", "ftp"].indexOf(realURL.scheme) == -1) {
|
||||
// Ignore items for non-URLs or URLs that aren't HTTP(S)/FTP
|
||||
|
|
|
@ -283,7 +283,7 @@ function getFirstResourceOfType(type) {
|
|||
}
|
||||
|
||||
function makeURI(aURL) {
|
||||
return Services.io.newURI(aURL, null, null);
|
||||
return Services.io.newURI(aURL);
|
||||
}
|
||||
|
||||
add_task(function* setup() {
|
||||
|
|
|
@ -210,7 +210,7 @@ add_task(function* checkUndoRemoval() {
|
|||
|
||||
// Insert 2 history visits
|
||||
let now_uSec = Date.now() * 1000;
|
||||
let visitedURI = Services.io.newURI("http://www.example.com/", null, null);
|
||||
let visitedURI = Services.io.newURI("http://www.example.com/");
|
||||
let frecencyUpdatePromise = new Promise(resolve => {
|
||||
let expectedChanges = 2;
|
||||
let observer = {
|
||||
|
|
|
@ -263,7 +263,7 @@ NewTabWebChannelImpl.prototype = {
|
|||
this._browsers = new Set();
|
||||
|
||||
if (this._prefs.enabled) {
|
||||
this._channel = new WebChannel(this.chanId, Services.io.newURI(this.origin, null, null));
|
||||
this._channel = new WebChannel(this.chanId, Services.io.newURI(this.origin));
|
||||
this._channel.listen(this._incomingMessage);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
|
|||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gPrincipal", function() {
|
||||
let uri = Services.io.newURI("about:newtab", null, null);
|
||||
let uri = Services.io.newURI("about:newtab");
|
||||
return Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
const TEST_PAGE = "http://example.net";
|
||||
const uri = Services.io.newURI(TEST_PAGE, null, null);
|
||||
const uri = Services.io.newURI(TEST_PAGE);
|
||||
|
||||
function disableCookies() {
|
||||
Services.cookies.removeAll();
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const TEST_URL = Services.io.newURI("http://example.com/", null, null);
|
||||
const MOZURISPEC = Services.io.newURI("http://mozilla.com/", null, null);
|
||||
const TEST_URL = Services.io.newURI("http://example.com/");
|
||||
const MOZURISPEC = Services.io.newURI("http://mozilla.com/");
|
||||
|
||||
add_task(function* () {
|
||||
let organizer = yield promiseLibrary();
|
||||
|
|
|
@ -155,7 +155,7 @@ function storeCache(aURL, aContent) {
|
|||
}
|
||||
};
|
||||
|
||||
storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
|
||||
storage.asyncOpenURI(Services.io.newURI(aURL), "",
|
||||
Ci.nsICacheStorage.OPEN_NORMALLY,
|
||||
storeCacheListener);
|
||||
});
|
||||
|
@ -174,8 +174,8 @@ function checkCache(aURL) {
|
|||
}
|
||||
};
|
||||
|
||||
storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
|
||||
Ci.nsICacheStorage.OPEN_READONLY,
|
||||
checkCacheListener);
|
||||
storage.asyncOpenURI(Services.io.newURI(aURL), "",
|
||||
Ci.nsICacheStorage.OPEN_READONLY,
|
||||
checkCacheListener);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ this.SiteDataManager = {
|
|||
let groups = this._appCache.getGroups();
|
||||
for (let site of this._sites.values()) {
|
||||
for (let group of groups) {
|
||||
let uri = Services.io.newURI(group, null, null);
|
||||
let uri = Services.io.newURI(group);
|
||||
if (site.perm.matchesURI(uri, true)) {
|
||||
let cache = this._appCache.getActiveCache(group);
|
||||
site.appCacheList.push(cache);
|
||||
|
|
|
@ -533,7 +533,7 @@ var gAdvancedPane = {
|
|||
|
||||
let usage = 0;
|
||||
for (let group of groups) {
|
||||
let uri = Services.io.newURI(group, null, null);
|
||||
let uri = Services.io.newURI(group);
|
||||
if (perm.matchesURI(uri, true)) {
|
||||
let cache = cacheService.getActiveCache(group);
|
||||
usage += cache.usage;
|
||||
|
@ -627,7 +627,7 @@ var gAdvancedPane = {
|
|||
getService(Components.interfaces.nsIApplicationCacheService);
|
||||
var groups = cacheService.getGroups();
|
||||
for (var i = 0; i < groups.length; i++) {
|
||||
var uri = Services.io.newURI(groups[i], null, null);
|
||||
var uri = Services.io.newURI(groups[i]);
|
||||
if (perm.matchesURI(uri, true)) {
|
||||
var cache = cacheService.getActiveCache(groups[i]);
|
||||
cache.discard();
|
||||
|
|
|
@ -1849,7 +1849,7 @@ var gApplicationsPane = {
|
|||
},
|
||||
|
||||
_getIconURLForWebApp(aWebAppURITemplate) {
|
||||
var uri = this._ioSvc.newURI(aWebAppURITemplate, null, null);
|
||||
var uri = this._ioSvc.newURI(aWebAppURITemplate);
|
||||
|
||||
// Unfortunately we can't use the favicon service to get the favicon,
|
||||
// because the service looks in the annotations table for a record with
|
||||
|
|
|
@ -37,7 +37,7 @@ function initTest() {
|
|||
// inject cookies
|
||||
for (v in vals) {
|
||||
let [host, name, value] = vals[v];
|
||||
var cookieUri = ios.newURI("http://" + host, null, null);
|
||||
var cookieUri = ios.newURI("http://" + host);
|
||||
cookieSvc.setCookieString(cookieUri, null, name + "=" + value + ";", null);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ var testRunner = {
|
|||
{
|
||||
expectPermObservancesDuringTestFunction: true,
|
||||
test(params) {
|
||||
let uri = params.ioService.newURI("http://test.com", null, null);
|
||||
let uri = params.ioService.newURI("http://test.com");
|
||||
params.pm.add(uri, "popup", Ci.nsIPermissionManager.DENY_ACTION);
|
||||
is(params.tree.view.rowCount, 0, "adding unrelated permission should not change display");
|
||||
params.btnApplyChanges.doCommand();
|
||||
|
@ -73,7 +73,7 @@ var testRunner = {
|
|||
observances: [{ type: "popup", origin: "http://test.com", data: "added",
|
||||
capability: Ci.nsIPermissionManager.DENY_ACTION }],
|
||||
cleanUp(params) {
|
||||
let uri = params.ioService.newURI("http://test.com", null, null);
|
||||
let uri = params.ioService.newURI("http://test.com");
|
||||
params.pm.remove(uri, "popup");
|
||||
},
|
||||
},
|
||||
|
@ -179,7 +179,7 @@ var testRunner = {
|
|||
expectPermObservancesDuringTestFunction: true,
|
||||
test(params) {
|
||||
for (let URL of ["http://a", "http://z", "http://b"]) {
|
||||
let URI = params.ioService.newURI(URL, null, null);
|
||||
let URI = params.ioService.newURI(URL);
|
||||
params.pm.add(URI, "cookie", Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ var testRunner = {
|
|||
"site should be sorted. 'a' should be third");
|
||||
|
||||
for (let URL of ["http://a", "http://z", "http://b"]) {
|
||||
let uri = params.ioService.newURI(URL, null, null);
|
||||
let uri = params.ioService.newURI(URL);
|
||||
params.pm.remove(uri, "cookie");
|
||||
}
|
||||
},
|
||||
|
|
|
@ -92,12 +92,12 @@ var gPermissionManager = {
|
|||
// permissions from being entered by the user.
|
||||
let uri;
|
||||
try {
|
||||
uri = Services.io.newURI(input_url, null, null);
|
||||
uri = Services.io.newURI(input_url);
|
||||
principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
|
||||
// If we have ended up with an unknown scheme, the following will throw.
|
||||
principal.origin;
|
||||
} catch (ex) {
|
||||
uri = Services.io.newURI("http://" + input_url, null, null);
|
||||
uri = Services.io.newURI("http://" + input_url);
|
||||
principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
|
||||
// If we have ended up with an unknown scheme, the following will throw.
|
||||
principal.origin;
|
||||
|
|
|
@ -64,10 +64,10 @@ function runTest() {
|
|||
let dir2 = newDirectory();
|
||||
let dir3 = newDirectory();
|
||||
|
||||
let uri1 = Services.io.newURI("http://test1.com/", null, null);
|
||||
let uri2 = Services.io.newURI("http://test2.com/", null, null);
|
||||
let uri3 = Services.io.newURI("http://test3.com/", null, null);
|
||||
let uri4 = Services.io.newURI("http://test4.com/", null, null);
|
||||
let uri1 = Services.io.newURI("http://test1.com/");
|
||||
let uri2 = Services.io.newURI("http://test2.com/");
|
||||
let uri3 = Services.io.newURI("http://test3.com/");
|
||||
let uri4 = Services.io.newURI("http://test4.com/");
|
||||
|
||||
// cleanup functions registration
|
||||
registerCleanupFunction(function () {
|
||||
|
|
|
@ -12,7 +12,7 @@ function test() {
|
|||
Cu.import("resource://gre/modules/DownloadLastDir.jsm", {}).DownloadLastDir;
|
||||
let MockFilePicker = SpecialPowers.MockFilePicker;
|
||||
let launcher = {
|
||||
source: Services.io.newURI("http://test1.com/file", null, null)
|
||||
source: Services.io.newURI("http://test1.com/file")
|
||||
};
|
||||
|
||||
MockFilePicker.init(window);
|
||||
|
|
|
@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
|||
|
||||
add_task(function* test() {
|
||||
const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.html"
|
||||
const TEST_URI = Services.io.newURI(TEST_URL, null, null);
|
||||
const TEST_URI = Services.io.newURI(TEST_URL);
|
||||
const TITLE_1 = "Title 1";
|
||||
const TITLE_2 = "Title 2";
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ add_task(function* () {
|
|||
.QueryInterface(Ci.nsIResProtocolHandler);
|
||||
let originalSubstitution = resProt.getSubstitution("search-plugins");
|
||||
resProt.setSubstitution("search-plugins",
|
||||
Services.io.newURI(url, null, null));
|
||||
Services.io.newURI(url));
|
||||
|
||||
let searchDonePromise;
|
||||
yield new Promise(resolve => {
|
||||
|
|
|
@ -109,7 +109,7 @@ var SessionStorageInternal = {
|
|||
|
||||
try {
|
||||
let attrs = aDocShell.getOriginAttributes();
|
||||
let originURI = Services.io.newURI(origin, null, null);
|
||||
let originURI = Services.io.newURI(origin);
|
||||
principal = Services.scriptSecurityManager.createCodebasePrincipal(originURI, attrs);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
|
@ -601,7 +601,7 @@ var SessionStorageListener = {
|
|||
// TODO: we should take browser.sessionstore.dom_storage_limit into an account here.
|
||||
if (docShell) {
|
||||
let {url, key, newValue} = event;
|
||||
let uri = Services.io.newURI(url, null, null);
|
||||
let uri = Services.io.newURI(url);
|
||||
let domain = uri.prePath;
|
||||
if (!this._changes) {
|
||||
this._changes = {};
|
||||
|
|
|
@ -16,7 +16,7 @@ add_task(function* () {
|
|||
yield promiseBrowserLoaded(browser);
|
||||
|
||||
// Load a new URI with a specific referrer.
|
||||
let referrerURI = Services.io.newURI(REFERRER1, null, null);
|
||||
let referrerURI = Services.io.newURI(REFERRER1);
|
||||
browser.loadURI("http://example.org", referrerURI, null);
|
||||
yield promiseBrowserLoaded(browser);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ let TestAboutPage = {
|
|||
|
||||
newChannel: function(aURI, aLoadInfo) {
|
||||
// about: page inception!
|
||||
let newURI = Services.io.newURI(SELFCHROMEURL, null, null);
|
||||
let newURI = Services.io.newURI(SELFCHROMEURL);
|
||||
let channel = Services.io.newChannelFromURIWithLoadInfo(newURI,
|
||||
aLoadInfo);
|
||||
channel.originalURI = aURI;
|
||||
|
|
|
@ -32,7 +32,7 @@ var UITourListener = {
|
|||
// Add any testing origins (comma-seperated) to the whitelist for the session.
|
||||
for (let origin of Services.prefs.getCharPref(PREF_TEST_WHITELIST).split(",")) {
|
||||
try {
|
||||
let testingURI = Services.io.newURI(origin, null, null);
|
||||
let testingURI = Services.io.newURI(origin);
|
||||
if (aURI.prePath == testingURI.prePath) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ add_task(function* test_windowless_UITour() {
|
|||
|
||||
// Allow the URL to use the UITour.
|
||||
info("Adding UITour permission to the test page.");
|
||||
let pageURI = Services.io.newURI(pageURL, null, null);
|
||||
let pageURI = Services.io.newURI(pageURL);
|
||||
Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);
|
||||
|
||||
// UITour's ping will resolve this promise.
|
||||
|
|
|
@ -354,8 +354,8 @@ function* setup_UITourTest() {
|
|||
// Use `add_task(setup_UITourTest);` instead as we will fold this into `setup_UITourTest` once all tests are using `add_UITour_task`.
|
||||
function UITourTest(usingAddTask = false) {
|
||||
Services.prefs.setBoolPref("browser.uitour.enabled", true);
|
||||
let testHttpsUri = Services.io.newURI("https://example.org", null, null);
|
||||
let testHttpUri = Services.io.newURI("http://example.org", null, null);
|
||||
let testHttpsUri = Services.io.newURI("https://example.org");
|
||||
let testHttpUri = Services.io.newURI("http://example.org");
|
||||
Services.perms.add(testHttpsUri, "uitour", Services.perms.ALLOW_ACTION);
|
||||
Services.perms.add(testHttpUri, "uitour", Services.perms.ALLOW_ACTION);
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ let FlyWebView = {
|
|||
|
||||
aDocument.getElementById("PanelUI-multiView").appendChild(panel);
|
||||
|
||||
this._sheetURI = Services.io.newURI("chrome://flyweb/skin/flyweb.css", null, null);
|
||||
this._sheetURI = Services.io.newURI("chrome://flyweb/skin/flyweb.css");
|
||||
aDocument.defaultView.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils).loadSheet(this._sheetURI, 1);
|
||||
},
|
||||
|
|
|
@ -0,0 +1,129 @@
|
|||
/* 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";
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["ProfileAutoCompleteResult"];
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
this.ProfileAutoCompleteResult = function(searchString,
|
||||
fieldName,
|
||||
matchingProfiles,
|
||||
{resultCode = null}) {
|
||||
this.searchString = searchString;
|
||||
this._fieldName = fieldName;
|
||||
this._matchingProfiles = matchingProfiles;
|
||||
|
||||
if (resultCode) {
|
||||
this.searchResult = resultCode;
|
||||
} else if (matchingProfiles.length > 0) {
|
||||
this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
|
||||
} else {
|
||||
this.searchResult = Ci.nsIAutoCompleteResult.RESULT_NOMATCH;
|
||||
}
|
||||
};
|
||||
|
||||
ProfileAutoCompleteResult.prototype = {
|
||||
|
||||
// The user's query string
|
||||
searchString: "",
|
||||
|
||||
// The default item that should be entered if none is selected
|
||||
defaultIndex: 0,
|
||||
|
||||
// The reason the search failed
|
||||
errorDescription: "",
|
||||
|
||||
// The result code of this result object.
|
||||
searchResult: null,
|
||||
|
||||
// The autocomplete attribute of the focused input field
|
||||
_fieldName: "",
|
||||
|
||||
// The matching profiles contains the information for filling forms.
|
||||
_matchingProfiles: null,
|
||||
|
||||
/**
|
||||
* @returns {number} The number of results
|
||||
*/
|
||||
get matchCount() {
|
||||
return this._matchingProfiles.length;
|
||||
},
|
||||
|
||||
_checkIndexBounds(index) {
|
||||
if (index < 0 || index >= this._matchingProfiles.length) {
|
||||
throw Components.Exception("Index out of range.", Cr.NS_ERROR_ILLEGAL_VALUE);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves a result
|
||||
* @param {number} index The index of the result requested
|
||||
* @returns {string} The result at the specified index
|
||||
*/
|
||||
getValueAt(index) {
|
||||
this._checkIndexBounds(index);
|
||||
return this._matchingProfiles[index].guid;
|
||||
},
|
||||
|
||||
getLabelAt(index) {
|
||||
this._checkIndexBounds(index);
|
||||
return this._matchingProfiles[index].organization;
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves a comment (metadata instance)
|
||||
* @param {number} index The index of the comment requested
|
||||
* @returns {string} The comment at the specified index
|
||||
*/
|
||||
getCommentAt(index) {
|
||||
this._checkIndexBounds(index);
|
||||
return this._matchingProfiles[index].streetAddress;
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves a style hint specific to a particular index.
|
||||
* @param {number} index The index of the style hint requested
|
||||
* @returns {string} The style hint at the specified index
|
||||
*/
|
||||
getStyleAt(index) {
|
||||
this._checkIndexBounds(index);
|
||||
return "autofill-profile";
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves an image url.
|
||||
* @param {number} index The index of the image url requested
|
||||
* @returns {string} The image url at the specified index
|
||||
*/
|
||||
getImageAt(index) {
|
||||
this._checkIndexBounds(index);
|
||||
return "";
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves a result
|
||||
* @param {number} index The index of the result requested
|
||||
* @returns {string} The result at the specified index
|
||||
*/
|
||||
getFinalCompleteValueAt(index) {
|
||||
return this.getValueAt(index);
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes a result from the resultset
|
||||
* @param {number} index The index of the result to remove
|
||||
* @param {boolean} removeFromDatabase TRUE for removing data from DataBase
|
||||
* as well.
|
||||
*/
|
||||
removeValueAt(index, removeFromDatabase) {
|
||||
// There is no plan to support removing profiles via autocomplete.
|
||||
},
|
||||
|
||||
// nsISupports
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult]),
|
||||
};
|
|
@ -11,8 +11,9 @@
|
|||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr, manager: Cm} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ProfileAutoCompleteResult",
|
||||
"resource://formautofill/ProfileAutoCompleteResult.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FormLikeFactory",
|
||||
"resource://gre/modules/FormLikeFactory.jsm");
|
||||
|
||||
|
@ -227,13 +228,19 @@ AutofillProfileAutoCompleteSearch.prototype = {
|
|||
*/
|
||||
startSearch(searchString, searchParam, previousResult, listener) {
|
||||
// TODO: These mock data should be replaced by form autofill API
|
||||
let labels = ["Mary", "John"];
|
||||
let values = ["Mary S.", "John S."];
|
||||
let comments = ["123 Sesame Street.", "331 E. Evelyn Avenue"];
|
||||
let result = new FormAutoCompleteResult(searchString,
|
||||
Ci.nsIAutoCompleteResult.RESULT_SUCCESS,
|
||||
0, "", values, labels,
|
||||
comments);
|
||||
let fieldName = "name";
|
||||
let profiles = [{
|
||||
guid: "test-guid-1",
|
||||
organization: "Sesame Street",
|
||||
streetAddress: "123 Sesame Street.",
|
||||
tel: "1-345-345-3456.",
|
||||
}, {
|
||||
guid: "test-guid-2",
|
||||
organization: "Mozilla",
|
||||
streetAddress: "331 E. Evelyn Avenue",
|
||||
tel: "1-650-903-0800",
|
||||
}];
|
||||
let result = new ProfileAutoCompleteResult(searchString, fieldName, profiles, {});
|
||||
|
||||
listener.onSearchResult(this, result);
|
||||
},
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
"use strict";
|
||||
|
||||
Cu.import("resource://formautofill/ProfileAutoCompleteResult.jsm");
|
||||
|
||||
let matchingProfiles = [{
|
||||
guid: "test-guid-1",
|
||||
organization: "Sesame Street",
|
||||
streetAddress: "123 Sesame Street.",
|
||||
tel: "1-345-345-3456.",
|
||||
}, {
|
||||
guid: "test-guid-2",
|
||||
organization: "Mozilla",
|
||||
streetAddress: "331 E. Evelyn Avenue",
|
||||
tel: "1-650-903-0800",
|
||||
}];
|
||||
|
||||
let testCases = [{
|
||||
options: {},
|
||||
matchingProfiles: matchingProfiles,
|
||||
searchString: "",
|
||||
fieldName: "",
|
||||
expected: {
|
||||
searchResult: Ci.nsIAutoCompleteResult.RESULT_SUCCESS,
|
||||
defaultIndex: 0,
|
||||
items: [{
|
||||
style: "autofill-profile",
|
||||
image: "",
|
||||
}, {
|
||||
style: "autofill-profile",
|
||||
image: "",
|
||||
}],
|
||||
},
|
||||
}, {
|
||||
options: {},
|
||||
matchingProfiles: [],
|
||||
searchString: "",
|
||||
fieldName: "",
|
||||
expected: {
|
||||
searchResult: Ci.nsIAutoCompleteResult.RESULT_NOMATCH,
|
||||
defaultIndex: 0,
|
||||
items: [],
|
||||
},
|
||||
}, {
|
||||
options: {resultCode: Ci.nsIAutoCompleteResult.RESULT_FAILURE},
|
||||
matchingProfiles: [],
|
||||
searchString: "",
|
||||
fieldName: "",
|
||||
expected: {
|
||||
searchResult: Ci.nsIAutoCompleteResult.RESULT_FAILURE,
|
||||
defaultIndex: 0,
|
||||
items: [],
|
||||
},
|
||||
}];
|
||||
|
||||
add_task(function* test_all_patterns() {
|
||||
testCases.forEach(pattern => {
|
||||
let actual = new ProfileAutoCompleteResult(pattern.searchString,
|
||||
pattern.fieldName,
|
||||
pattern.matchingProfiles,
|
||||
pattern.options);
|
||||
let expectedValue = pattern.expected;
|
||||
equal(actual.searchResult, expectedValue.searchResult);
|
||||
equal(actual.defaultIndex, expectedValue.defaultIndex);
|
||||
equal(actual.matchCount, expectedValue.items.length);
|
||||
expectedValue.items.forEach((item, index) => {
|
||||
// TODO: getValueAt, getLabelAt, and getCommentAt should be verified here.
|
||||
equal(actual.getStyleAt(index), item.style);
|
||||
equal(actual.getImageAt(index), item.image);
|
||||
});
|
||||
|
||||
if (expectedValue.items.length != 0) {
|
||||
Assert.throws(() => actual.getValueAt(expectedValue.items.length),
|
||||
/Index out of range\./);
|
||||
|
||||
Assert.throws(() => actual.getLabelAt(expectedValue.items.length),
|
||||
/Index out of range\./);
|
||||
|
||||
Assert.throws(() => actual.getCommentAt(expectedValue.items.length),
|
||||
/Index out of range\./);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -6,6 +6,7 @@ support-files =
|
|||
|
||||
[test_autofillFormFields.js]
|
||||
[test_collectFormFields.js]
|
||||
[test_populateFieldValues.js]
|
||||
[test_profileStorage.js]
|
||||
[test_markAsAutofillField.js]
|
||||
[test_populateFieldValues.js]
|
||||
[test_profileAutocompleteResult.js]
|
||||
[test_profileStorage.js]
|
||||
|
|
|
@ -1017,7 +1017,7 @@ PdfStreamConverter.prototype = {
|
|||
// from the request channel to keep isolation consistent.
|
||||
var ssm = Cc['@mozilla.org/scriptsecuritymanager;1']
|
||||
.getService(Ci.nsIScriptSecurityManager);
|
||||
var uri = NetUtil.newURI(PDF_VIEWER_WEB_PAGE, null, null);
|
||||
var uri = NetUtil.newURI(PDF_VIEWER_WEB_PAGE);
|
||||
var resourcePrincipal;
|
||||
resourcePrincipal =
|
||||
ssm.createCodebasePrincipal(uri, aRequest.loadInfo.originAttributes);
|
||||
|
|
|
@ -26,7 +26,7 @@ XPCOMUtils.defineLazyGetter(this, "gPocketBundle", function() {
|
|||
return Services.strings.createBundle("chrome://pocket/locale/pocket.properties");
|
||||
});
|
||||
XPCOMUtils.defineLazyGetter(this, "gPocketStyleURI", function() {
|
||||
return Services.io.newURI("chrome://pocket/skin/pocket.css", null, null);
|
||||
return Services.io.newURI("chrome://pocket/skin/pocket.css");
|
||||
});
|
||||
|
||||
// Due to bug 1051238 frame scripts are cached forever, so we can't update them
|
||||
|
@ -183,7 +183,7 @@ var PocketContextMenu = {
|
|||
subject.isContentSelected || subject.onImage ||
|
||||
subject.onCanvas || subject.onVideo || subject.onAudio);
|
||||
let targetUrl = subject.onLink ? subject.linkUrl : subject.pageUrl;
|
||||
let targetURI = Services.io.newURI(targetUrl, null, null);
|
||||
let targetURI = Services.io.newURI(targetUrl);
|
||||
let canPocket = pocketEnabled && (targetURI.schemeIs("http") || targetURI.schemeIs("https") ||
|
||||
(targetURI.schemeIs("about") && ReaderMode.getOriginalUrl(targetUrl)));
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ AboutPage.prototype = {
|
|||
},
|
||||
|
||||
newChannel(aURI, aLoadInfo) {
|
||||
let newURI = Services.io.newURI(this.chromeURL, null, null);
|
||||
let newURI = Services.io.newURI(this.chromeURL);
|
||||
let channel = Services.io.newChannelFromURIWithLoadInfo(newURI,
|
||||
aLoadInfo);
|
||||
channel.originalURI = aURI;
|
||||
|
|
|
@ -19,7 +19,7 @@ const REASONS = {
|
|||
};
|
||||
|
||||
const PREF_BRANCH = "extensions.shield-recipe-client.";
|
||||
const PREFS = {
|
||||
const DEFAULT_PREFS = {
|
||||
api_url: "https://self-repair.mozilla.org/api/v1",
|
||||
dev_mode: false,
|
||||
enabled: true,
|
||||
|
@ -35,7 +35,7 @@ this.install = function() {
|
|||
// next startup to run, unless the dev_mode preference is set.
|
||||
if (Preferences.get(PREF_SELF_SUPPORT_ENABLED, true)) {
|
||||
Preferences.set(PREF_SELF_SUPPORT_ENABLED, false);
|
||||
if (!Services.prefs.getBoolPref(PREF_DEV_MODE, false)) {
|
||||
if (!Preferences.get(PREF_DEV_MODE, false)) {
|
||||
shouldRun = false;
|
||||
}
|
||||
}
|
||||
|
@ -82,21 +82,11 @@ this.uninstall = function() {
|
|||
};
|
||||
|
||||
function setDefaultPrefs() {
|
||||
const branch = Services.prefs.getDefaultBranch(PREF_BRANCH);
|
||||
for (const [key, val] of Object.entries(PREFS)) {
|
||||
for (const [key, val] of Object.entries(DEFAULT_PREFS)) {
|
||||
const fullKey = PREF_BRANCH + key;
|
||||
// If someone beat us to setting a default, don't overwrite it.
|
||||
if (branch.getPrefType(key) !== branch.PREF_INVALID)
|
||||
continue;
|
||||
switch (typeof val) {
|
||||
case "boolean":
|
||||
branch.setBoolPref(key, val);
|
||||
break;
|
||||
case "number":
|
||||
branch.setIntPref(key, val);
|
||||
break;
|
||||
case "string":
|
||||
branch.setCharPref(key, val);
|
||||
break;
|
||||
if (!Preferences.isSet(fullKey)) {
|
||||
Preferences.set(fullKey, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -729,7 +729,6 @@ decoder.noCodecs.button = Learn how
|
|||
decoder.noCodecs.accesskey = L
|
||||
decoder.noCodecs.message = To play video, you may need to install Microsoft’s Media Feature Pack.
|
||||
decoder.noCodecsVista.message = To play video, you may need to install Microsoft’s Platform Update Supplement for Windows Vista.
|
||||
decoder.noCodecsXP.message = To play video, you may need to enable Adobe’s Primetime Content Decryption Module.
|
||||
decoder.noCodecsLinux.message = To play video, you may need to install the required video codecs.
|
||||
decoder.noHWAcceleration.message = To improve video quality, you may need to install Microsoft’s Media Feature Pack.
|
||||
decoder.noHWAccelerationVista.message = To improve video quality, you may need to install Microsoft’s Platform Update Supplement for Windows Vista.
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче