Bug 1428264 - Do not show chrome urls in storage inspector r?pbro
On investigation it turns out that no storage types are supported for chrome:// urls.
MozReview-Commit-ID: JZcQg5FvfvN
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -158,31 +158,32 @@ StorageActors.defaults = function(typeNa
getHostName(location) {
if (!location) {
// Debugging a legacy Firefox extension... no hostname available and no
// storage possible.
return null;
}
switch (location.protocol) {
+ case "about:":
+ return `${location.protocol}${location.pathname}`;
+ case "chrome:":
+ // chrome: URLs do not support storage of any type.
+ return null;
case "data:":
// data: URLs do not support storage of any type.
return null;
- case "about:":
- return location.protocol + location.pathname;
- case "chrome:":
- return location.protocol + location.pathname;
case "file:":
return `${location.protocol}//${location.pathname}`;
- case "resource:":
- return location.origin + location.pathname;
+ case "javascript:":
+ return location.href;
case "moz-extension:":
return location.origin;
- case "javascript:":
- return location.href;
+ case "resource:":
+ return `${location.origin}${location.pathname}`;
default:
// http: or unknown protocol.
return `${location.protocol}//${location.host}`;
}
},
initialize(storageActor) {
protocol.Actor.prototype.initialize.call(this, null);