|
|
@@ -42,12 +42,14 @@ singlefile.extension.core.bg.autosave = (() => {
|
|
|
if (message.method.endsWith(".save")) {
|
|
|
const tabId = sender.tab.id;
|
|
|
const options = await singlefile.extension.core.bg.config.getOptions(sender.tab.url, true);
|
|
|
- if (options.autoClose) {
|
|
|
- singlefile.extension.core.bg.tabs.remove(tabId);
|
|
|
+ if (options) {
|
|
|
+ if (options.autoClose) {
|
|
|
+ singlefile.extension.core.bg.tabs.remove(tabId);
|
|
|
+ }
|
|
|
+ ui.onStart(tabId, 1, true);
|
|
|
+ await saveContent(message, sender.tab);
|
|
|
+ ui.onEnd(tabId, true);
|
|
|
}
|
|
|
- ui.onStart(tabId, 1, true);
|
|
|
- await saveContent(message, sender.tab);
|
|
|
- ui.onEnd(tabId, true);
|
|
|
return {};
|
|
|
}
|
|
|
}
|