Răsfoiți Sursa

set "remove hidden elements" active by default

Gildas 7 ani în urmă
părinte
comite
0ce0218abb

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

@@ -23,7 +23,7 @@
 singlefile.config = (() => {
 
 	const DEFAULT_CONFIG = {
-		removeHiddenElements: false,
+		removeHiddenElements: true,
 		removeUnusedStyles: true,
 		removeFrames: false,
 		removeImports: true,
@@ -142,6 +142,9 @@ singlefile.config = (() => {
 		if (config.groupDuplicateImages === undefined) {
 			config.groupDuplicateImages = true;
 		}
+		if (config.removeHiddenElements === undefined) {
+			config.removeHiddenElements = true;
+		}
 		if (config.autoSaveLoadOrUnload === undefined && !config.autoSaveUnload) {
 			config.autoSaveLoadOrUnload = true;
 			config.autoSaveLoad = false;

+ 13 - 14
extension/ui/pages/help.html

@@ -199,26 +199,28 @@
 
 					<li>
 						<span class="option">remove HTML imports</span>
-						<p>Check this option to remove all link elements used to import HTML documents. This can reduce the size of the
+						<p>Check this option to remove all link elements used to import HTML documents. This can help to reduce the size
+							of the
 							file
 							without altering the document most of the time.</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. This option can help to reduce the size of the file
+							without altering the document.</p>
+						<p class="notice">It is recommended to
+							<u>check</u> this option</p>
+					</li>
+
 					<li>
 						<span class="option">remove frames</span>
 						<p>Check this option to remove all frame and iframe elements. This can considerably reduce the size of the file
 							without altering the document most of the time. Checking this option may also decrease the time needed to save a
 							page</p>
 					</li>
-
-					<li>
-						<span class="option">remove hidden elements</span>
-						<p>Check this option to remove all hidden elements. This option can considerably reduce the size of the file
-							without
-							altering the document most of the time.</p>
-					</li>
 				</ul>
 				<p>Images</p>
 				<ul>
@@ -273,10 +275,8 @@
 					<li>
 						<span class="option">remove alternative fonts to woff/otf and unused fonts</span>
 						<p>Check this option to remove fonts that are alternatives to the Web Open Font or OpenType formats, and CSS
-							fonts
-							that are not used. Checking this this option should not alter the document and can considerably reduce the size
-							of
-							the file.</p>
+							fonts that are not used. 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>
@@ -284,8 +284,7 @@
 					<li>
 						<span class="option">remove stylesheets for alternative devices to screens</span>
 						<p>Check this option to remove stylesheets that are not used for the screen display like stylesheets for print
-							preview
-							and speech synthesizers. Checking this this option can reduce the size of the file.</p>
+							preview and speech synthesizers. Checking this this option can help to reduce the size of the file.</p>
 					</li>
 				</ul>
 				<p>Other resources</p>

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

@@ -45,17 +45,17 @@
 			<label for="removeImportsInput" id="removeImportsLabel"></label>
 			<input type="checkbox" id="removeImportsInput">
 		</div>
-		<div class="option">
-			<label for="removeFramesInput" id="removeFramesLabel"></label>
-			<input type="checkbox" id="removeFramesInput">
-		</div>
 		<div class="option">
 			<label for="removeHiddenElementsInput" id="removeHiddenElementsLabel"></label>
 			<input type="checkbox" id="removeHiddenElementsInput">
 		</div>
+		<div class="option">
+			<label for="removeFramesInput" id="removeFramesLabel"></label>
+			<input type="checkbox" id="removeFramesInput">
+		</div>
 	</details>
 	<details>
-		<summary id="imagesLabel"></summary>		
+		<summary id="imagesLabel"></summary>
 		<div class="option">
 			<label for="groupDuplicateImagesInput" id="groupDuplicateImagesLabel"></label>
 			<input type="checkbox" id="groupDuplicateImagesInput">