Fixed settings export button broken on Vivaldi (issue #124).

This commit is contained in:
hackademix 2019-12-30 15:37:48 +01:00
parent 6166f8f280
commit ab865d14c2
1 changed files with 5 additions and 2 deletions

View File

@ -71,7 +71,11 @@
let button = e.target; let button = e.target;
button.disabled = true; button.disabled = true;
let settings = await UI.exportSettings(); let settings = await UI.exportSettings();
let f = document.createElement("iframe"); let id = "noscriptExportFrame";
let f = document.getElementById(id);
if (f) f.remove();
f = document.createElement("iframe");
f.id = id;
f.srcdoc = `<a download="noscript_data.txt" target="_blank">NoScript Export</a>`; f.srcdoc = `<a download="noscript_data.txt" target="_blank">NoScript Export</a>`;
f.style.position = "fixed"; f.style.position = "fixed";
f.style.top = "-999px"; f.style.top = "-999px";
@ -84,7 +88,6 @@
})); }));
a.click(); a.click();
setTimeout(() => { setTimeout(() => {
f.remove();
button.disabled = false; button.disabled = false;
}, 1000); }, 1000);