summaryrefslogtreecommitdiff
path: root/ext/js/background/offscreen.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 14:55:27 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 14:55:27 -0500
commit7aed9a371b0d74c0d75179a08068e8935b76d780 (patch)
tree2d895b20e31cb03c8200e4429d987c6d253b1da7 /ext/js/background/offscreen.js
parent5dc16745468c229e7c31f6cddaad83fb9c36b98f (diff)
Update types
Diffstat (limited to 'ext/js/background/offscreen.js')
-rw-r--r--ext/js/background/offscreen.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/js/background/offscreen.js b/ext/js/background/offscreen.js
index 27cee8c4..6302aa84 100644
--- a/ext/js/background/offscreen.js
+++ b/ext/js/background/offscreen.js
@@ -50,6 +50,7 @@ export class Offscreen {
this._messageHandlers = new Map([
['clipboardGetTextOffscreen', {async: true, contentScript: true, handler: this._getTextHandler.bind(this)}],
['clipboardGetImageOffscreen', {async: true, contentScript: true, handler: this._getImageHandler.bind(this)}],
+ ['clipboardSetBrowserOffsecreen', {async: false, contentScript: true, handler: this._setClipboardBrowser.bind(this)}],
['databasePrepareOffscreen', {async: true, contentScript: true, handler: this._prepareDatabaseHandler.bind(this)}],
['getDictionaryInfoOffscreen', {async: true, contentScript: true, handler: this._getDictionaryInfoHandler.bind(this)}],
['databasePurgeOffscreen', {async: true, contentScript: true, handler: this._purgeDatabaseHandler.bind(this)}],
@@ -59,7 +60,6 @@ export class Offscreen {
['findTermsOffscreen', {async: true, contentScript: true, handler: this._findTermsHandler.bind(this)}],
['getTermFrequenciesOffscreen', {async: true, contentScript: true, handler: this._getTermFrequenciesHandler.bind(this)}],
['clearDatabaseCachesOffscreen', {async: false, contentScript: true, handler: this._clearDatabaseCachesHandler.bind(this)}]
-
]);
const onMessage = this._onMessage.bind(this);
@@ -76,6 +76,13 @@ export class Offscreen {
return this._clipboardReader.getImage();
}
+ /**
+ * @param {{value: import('environment').Browser}} details
+ */
+ _setClipboardBrowser({value}) {
+ this._clipboardReader.browser = value;
+ }
+
_prepareDatabaseHandler() {
if (this._prepareDatabasePromise !== null) {
return this._prepareDatabasePromise;