Ver código fonte

set "remove unused CSS rules" true by default

Gildas 7 anos atrás
pai
commit
3f6f52ac59

+ 4 - 1
extension/core/bg/config.js

@@ -24,7 +24,7 @@ singlefile.config = (() => {
 
 	const DEFAULT_CONFIG = {
 		removeHiddenElements: false,
-		removeUnusedCSSRules: false,
+		removeUnusedCSSRules: true,
 		removeFrames: true,
 		removeImports: true,
 		removeScripts: true,
@@ -89,6 +89,9 @@ singlefile.config = (() => {
 		if (config.maxResourceSize === 0) {
 			config.maxResourceSize = 1;
 		}
+		if (config.removeUnusedCSSRules === undefined) {
+			config.removeUnusedCSSRules = true;
+		}
 	}
 
 	return {

+ 8 - 9
extension/ui/pages/help.html

@@ -112,6 +112,14 @@
 							<u>check</u> this option</p>
 					</li>
 
+					<li>
+						<span class="option">remove unused CSS rules</span>
+						<p>Check this option to remove all CSS rules that do not match any element. Checking this this option should not alter
+							the document and can considerably reduce the size of the file.</p>
+						<p class="notice">It is recommended to
+							<u>check</u> this option</p>
+					</li>
+
 					<li>
 						<span class="option">remove hidden elements</span>
 						<p>Check this option to remove all hidden elements (
@@ -122,15 +130,6 @@
 							<u>uncheck</u> this option</p>
 					</li>
 
-					<li>
-						<span class="option">remove unused CSS rules</span>
-						<p>Check this option to remove all CSS rules that do not match any element. Checking this this option may alter the document
-							but can considerably reduce the size of the file. It may also introduce some incompatibilities issues in the saved
-							page when opening it into another browser (i.e. not based on Chromium).</p>
-						<p class="notice">It is recommended to
-							<u>uncheck</u> this option</p>
-					</li>
-
 					<li>
 						<span class="option">save raw page</span>
 						<p>Check this option to save the page without interpreting JavaScript. Checking this option may alter the document.</p>

+ 4 - 4
extension/ui/pages/options.html

@@ -50,14 +50,14 @@
 				<label for="removeScriptsInput">remove scripts</label>
 				<input type="checkbox" id="removeScriptsInput">
 			</div>
-			<div class="option">
-				<label for="removeHiddenElementsInput">remove hidden elements</label>
-				<input type="checkbox" id="removeHiddenElementsInput">
-			</div>
 			<div class="option">
 				<label for="removeUnusedCSSRulesInput">remove unused CSS rules</label>
 				<input type="checkbox" id="removeUnusedCSSRulesInput">
 			</div>
+			<div class="option">
+				<label for="removeHiddenElementsInput">remove hidden elements</label>
+				<input type="checkbox" id="removeHiddenElementsInput">
+			</div>
 			<div class="option">
 				<label for="saveRawPageInput">save raw page</label>
 				<input type="checkbox" id="saveRawPageInput">