Read file in the current window context before passing to backend

This commit is contained in:
toasted-nutbread 2019-12-13 23:22:25 -05:00
parent e417a3fda3
commit 300282e3b4

View File

@ -107,11 +107,7 @@ function utilDatabaseDeleteDictionary(dictionaryName, onProgress) {
} }
async function utilDatabaseImport(data, progress, details) { async function utilDatabaseImport(data, progress, details) {
// Edge cannot read data on the background page due to the File object
// being created from a different window. Read on the same page instead.
if (EXTENSION_IS_BROWSER_EDGE) {
data = await utilReadFile(data); data = await utilReadFile(data);
}
return utilBackend().translator.database.importDictionary(data, progress, details); return utilBackend().translator.database.importDictionary(data, progress, details);
} }