summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-13 23:23:15 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-14 11:12:39 -0500
commit87ece13647aae3f670f03d7f5667f638bee23bcb (patch)
treeb79b207f6fd70e46a36af5caf06f388efca90035 /ext/bg
parent300282e3b4cd98b626509671693a35f7249a77c2 (diff)
Isolate arguments passed across window contexts
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/settings/main.js4
-rw-r--r--ext/bg/js/util.js20
2 files changed, 19 insertions, 5 deletions
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js
index 315766e0..78a5870c 100644
--- a/ext/bg/js/settings/main.js
+++ b/ext/bg/js/settings/main.js
@@ -17,7 +17,9 @@
*/
function getOptionsMutable(optionsContext) {
- return utilBackend().getOptions(optionsContext);
+ return utilBackend().getOptions(
+ utilBackgroundIsolate(optionsContext)
+ );
}
function getOptionsFullMutable() {
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index 81cb0e71..f7f6e770 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -91,11 +91,16 @@ function utilDatabaseGetDictionaryInfo() {
}
function utilDatabaseGetDictionaryCounts(dictionaryNames, getTotal) {
- return utilBackend().translator.database.getDictionaryCounts(dictionaryNames, getTotal);
+ return utilBackend().translator.database.getDictionaryCounts(
+ utilBackgroundIsolate(dictionaryNames),
+ utilBackgroundIsolate(getTotal)
+ );
}
function utilAnkiGetModelFieldNames(modelName) {
- return utilBackend().anki.getModelFieldNames(modelName);
+ return utilBackend().anki.getModelFieldNames(
+ utilBackgroundIsolate(modelName)
+ );
}
function utilDatabasePurge() {
@@ -103,12 +108,19 @@ function utilDatabasePurge() {
}
function utilDatabaseDeleteDictionary(dictionaryName, onProgress) {
- return utilBackend().translator.database.deleteDictionary(dictionaryName, onProgress);
+ return utilBackend().translator.database.deleteDictionary(
+ utilBackgroundIsolate(dictionaryName),
+ onProgress
+ );
}
async function utilDatabaseImport(data, progress, details) {
data = await utilReadFile(data);
- return utilBackend().translator.database.importDictionary(data, progress, details);
+ return utilBackend().translator.database.importDictionary(
+ utilBackgroundIsolate(data),
+ progress,
+ utilBackgroundIsolate(details)
+ );
}
function utilReadFile(file) {