diff --git a/dom/ipc/manifestMessages.js b/dom/ipc/manifestMessages.js index ce84ebcf4b3..d236b01d4d0 100644 --- a/dom/ipc/manifestMessages.js +++ b/dom/ipc/manifestMessages.js @@ -69,20 +69,11 @@ function fetchManifest() { } // Will throw on "about:blank" and possibly other invalid URIs. const manifestURL = new content.URL(elem.href, elem.baseURI); - const reqInit = {}; - switch (elem.crossOrigin) { - case 'use-credentials': - reqInit.credentials = 'include'; - reqInit.mode = 'cors'; - break; - case 'anonymous': - reqInit.credentials = 'omit'; - reqInit.mode = 'cors'; - break; - default: - reqInit.credentials = 'same-origin'; - reqInit.mode = 'no-cors'; - break; + const reqInit = { + mode: 'cors' + }; + if (elem.crossOrigin === 'use-credentials') { + reqInit.credentials = 'include'; } const req = new content.Request(manifestURL, reqInit); req.setContext('manifest'); diff --git a/dom/manifest/test/browser_ManifestObtainer_obtain.js b/dom/manifest/test/browser_ManifestObtainer_obtain.js index fc446c54891..17b664ea3d9 100644 --- a/dom/manifest/test/browser_ManifestObtainer_obtain.js +++ b/dom/manifest/test/browser_ManifestObtainer_obtain.js @@ -44,7 +44,7 @@ const tests = [ ` }, { - expected: 'By default, manifest load cross-origin.', + expected: 'By default, manifest cannot load cross-origin.', get tabURL() { let query = [ `body=

${this.expected}

`, @@ -53,9 +53,8 @@ const tests = [ const URL = `${defaultURL}?${query.join('&')}`; return URL; }, - run(manifest) { - // Waiting on https://bugzilla.mozilla.org/show_bug.cgi?id=1130924 - todo_is(manifest.name, 'pass-3', this.expected); + run(err) { + Assert.strictEqual(err.name, 'TypeError', this.expected); }, testData: `` },