summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-14 16:40:05 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-29 12:33:15 -0500
commitd2da4f7e62c42ed7f9fd82c8af2f1d9968bec2ce (patch)
treed6093de076f207a25c26ce8939218dc7df22bfef
parent50e0fbbb662230a3a9f6e7354c229200bd1a03a2 (diff)
Add apiOptionsSchemaGet
-rw-r--r--ext/bg/js/backend.js12
-rw-r--r--ext/mixed/js/api.js4
2 files changed, 16 insertions, 0 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 55841cd6..245e3de2 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -115,6 +115,13 @@ class Backend {
}
}
+ async getOptionsSchema() {
+ if (this.isPreparedPromise !== null) {
+ await this.isPreparedPromise;
+ }
+ return this.optionsSchema;
+ }
+
async getFullOptions() {
if (this.isPreparedPromise !== null) {
await this.isPreparedPromise;
@@ -200,6 +207,10 @@ class Backend {
// Message handlers
+ _onApiOptionsSchemaGet() {
+ return this.getOptionsSchema();
+ }
+
_onApiOptionsGet({optionsContext}) {
return this.getOptions(optionsContext);
}
@@ -692,6 +703,7 @@ class Backend {
}
Backend._messageHandlers = new Map([
+ ['optionsSchemaGet', (self, ...args) => self._onApiOptionsSchemaGet(...args)],
['optionsGet', (self, ...args) => self._onApiOptionsGet(...args)],
['optionsGetFull', (self, ...args) => self._onApiOptionsGetFull(...args)],
['optionsSet', (self, ...args) => self._onApiOptionsSet(...args)],
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index 18b360a3..dc901efc 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -17,6 +17,10 @@
*/
+function apiOptionsSchemaGet() {
+ return _apiInvoke('optionsSchemaGet');
+}
+
function apiOptionsGet(optionsContext) {
return _apiInvoke('optionsGet', {optionsContext});
}