Browse Source

fixed minor configuration initialization issues

Gildas 7 năm trước cách đây
mục cha
commit
02760a82b4
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      extension/core/bg/config.js

+ 6 - 2
extension/core/bg/config.js

@@ -32,7 +32,6 @@ singlefile.config = (() => {
 		removeFrames: false,
 		removeImports: true,
 		removeScripts: true,
-		rawDocument: false,
 		compressHTML: true,
 		compressCSS: true,
 		loadDeferredImages: true,
@@ -96,7 +95,7 @@ singlefile.config = (() => {
 			config.autoSaveUnload = false;
 		}
 		if (!config.maxResourceSize) {
-			config.maxResourceSize = 1;
+			config.maxResourceSize = DEFAULT_CONFIG.maxResourceSize;
 		}
 		if (config.appendSaveDate !== undefined) {
 			delete config.appendSaveDate;
@@ -255,6 +254,11 @@ singlefile.config = (() => {
 			config.rules = config.rules.filter(rule => rule.url != url);
 			await browser.storage.local.set({ rules: config.rules });
 		},
+		async deleteRules(profileName) {
+			const config = await getConfig();
+			config.rules = config.rules = profileName ? config.rules.filter(rule => rule.autoSaveProfile != profileName && rule.profile != profileName) : [];
+			await browser.storage.local.set({ rules: config.rules });
+		},
 		async updateRule(url, newURL, profile, autoSaveProfile) {
 			if (!url || !newURL) {
 				throw new Error("URL is empty");