From d2da4f7e62c42ed7f9fd82c8af2f1d9968bec2ce Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 14 Dec 2019 16:40:05 -0500 Subject: Add apiOptionsSchemaGet --- ext/bg/js/backend.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ext/bg/js') 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)], -- cgit v1.2.3