firefox fixes
This commit is contained in:
parent
8ed3ca6fd4
commit
84d2204d96
@ -18,15 +18,11 @@
|
||||
|
||||
|
||||
async function apiOptionsSet(options) {
|
||||
// In Firefox, setting options from the options UI somehow carries references
|
||||
// to the DOM across to the background page, causing the options object to
|
||||
// become a "DeadObject" after the options page is closed. The workaround used
|
||||
// here is to create a deep copy of the options object.
|
||||
utilBackend().onOptionsUpdated(JSON.parse(JSON.stringify(options)));
|
||||
utilBackend().onOptionsUpdated(utilIsolate(options));
|
||||
}
|
||||
|
||||
async function apiOptionsGet() {
|
||||
return utilBackend().options;
|
||||
return utilIsolate(utilBackend().options);
|
||||
}
|
||||
|
||||
async function apiTermsFind(text) {
|
||||
|
@ -22,6 +22,10 @@ function utilAsync(func) {
|
||||
};
|
||||
}
|
||||
|
||||
function utilIsolate(data) {
|
||||
return JSON.parse(JSON.stringify(data));
|
||||
}
|
||||
|
||||
function utilBackend() {
|
||||
return chrome.extension.getBackgroundPage().yomichan_backend;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user