Add Tampermonkey WebExtension manifest and managed storage compatibility

This commit is contained in:
wuggy 2026-09-19 04:45:24 -07:00
commit cc3106406f
5 changed files with 80 additions and 3 deletions

View file

@ -29,6 +29,27 @@ function storageApiFactory(context) {
},
},
// UXP has no enterprise managed-storage backend. Expose the namespace
// as an empty, read-only area so extensions can feature-detect it and
// continue using their defaults.
managed: {
get: function(spec) {
return ExtensionStorage.getManaged(spec);
},
set: function() {
throw new context.cloneScope.Error(
"storage.managed is read-only");
},
remove: function() {
throw new context.cloneScope.Error(
"storage.managed is read-only");
},
clear: function() {
throw new context.cloneScope.Error(
"storage.managed is read-only");
},
},
onChanged: new EventManager(context, "storage.onChanged", fire => {
let listenerLocal = changes => {
fire(changes, "local");