diff --git a/devtools/server/actors/storage.js b/devtools/server/actors/storage.js index 35fa2172e79f..fee79f07803a 100644 --- a/devtools/server/actors/storage.js +++ b/devtools/server/actors/storage.js @@ -1219,8 +1219,12 @@ StorageActors.createActor({ }, { getCachesForHost: Task.async(function* (host) { let uri = Services.io.newURI(host); + let attrs = this.storageActor + .document + .nodePrincipal + .originAttributes; let principal = - Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri); + Services.scriptSecurityManager.createCodebasePrincipal(uri, attrs); // The first argument tells if you want to get |content| cache or |chrome| // cache. @@ -1664,11 +1668,11 @@ StorageActors.createActor({ populateStoresForHost: Task.async(function* (host) { let storeMap = new Map(); - let {names} = yield this.getDBNamesForHost(host); let win = this.storageActor.getWindowFromHost(host); if (win) { let principal = win.document.nodePrincipal; + let {names} = yield this.getDBNamesForHost(host, principal); for (let {name, storage} of names) { let metadata = yield this.getDBMetaData(host, principal, name, storage); @@ -2025,8 +2029,8 @@ var indexedDBHelpers = { /** * Fetches all the databases and their metadata for the given `host`. */ - getDBNamesForHost: Task.async(function* (host) { - let sanitizedHost = this.getSanitizedHost(host); + getDBNamesForHost: Task.async(function* (host, principal) { + let sanitizedHost = this.getSanitizedHost(host) + principal.originSuffix; let profileDir = OS.Constants.Path.profileDir; let files = []; let names = []; @@ -2363,8 +2367,8 @@ var indexedDBHelpers = { return indexedDBHelpers.splitNameAndStorage(name); } case "getDBNamesForHost": { - let [host] = args; - return indexedDBHelpers.getDBNamesForHost(host); + let [host, principal] = args; + return indexedDBHelpers.getDBNamesForHost(host, principal); } case "getValuesForHost": { let [host, name, options, hostVsStores, principal] = args;