mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 15:57:31 +09:00
Add Tampermonkey WebExtension manifest and managed storage compatibility
This commit is contained in:
parent
5ac0d5acc3
commit
cc3106406f
5 changed files with 80 additions and 3 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue