From 938eb53576641d93bfa18775029f2edf7d4e76fc Mon Sep 17 00:00:00 2001 From: hackademix Date: Thu, 10 Dec 2020 13:13:25 +0100 Subject: [PATCH] Explicit failure for wrong settings importation formats. --- src/bg/Settings.js | 3 ++- src/ui/options.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bg/Settings.js b/src/bg/Settings.js index 73182f4..0297ec4 100644 --- a/src/bg/Settings.js +++ b/src/bg/Settings.js @@ -15,7 +15,8 @@ var Settings = { return await this.importSettings(json); } } catch (e) { - return await this.importLists(data); + if (data.includes("[UNTRUSTED]")) await this.importLists(data); + else throw e; } }, diff --git a/src/ui/options.js b/src/ui/options.js index bc720ea..fddd582 100644 --- a/src/ui/options.js +++ b/src/ui/options.js @@ -57,6 +57,8 @@ await UI.importSettings(fr.result); } catch (e) { error(e, "Importing settings %s", fr.result); + alert(e); + return; } location.reload(); }