فهرست منبع

set "remove hidden elements" active by default

Gildas 7 سال پیش
والد
کامیت
0ce0218abb
3فایلهای تغییر یافته به همراه22 افزوده شده و 20 حذف شده
  1. 4 1
      extension/core/bg/config.js
  2. 13 14
      extension/ui/pages/help.html
  3. 5 5
      extension/ui/pages/options.html

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

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

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

@@ -199,26 +199,28 @@
 
 
 					<li>
 					<li>
 						<span class="option">remove HTML imports</span>
 						<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
 							file
 							without altering the document most of the time.</p>
 							without altering the document most of the time.</p>
 						<p class="notice">It is recommended to
 						<p class="notice">It is recommended to
 							<u>check</u> this option</p>
 							<u>check</u> this option</p>
 					</li>
 					</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>
 					<li>
 						<span class="option">remove frames</span>
 						<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
 						<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
 							without altering the document most of the time. Checking this option may also decrease the time needed to save a
 							page</p>
 							page</p>
 					</li>
 					</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>
 				</ul>
 				<p>Images</p>
 				<p>Images</p>
 				<ul>
 				<ul>
@@ -273,10 +275,8 @@
 					<li>
 					<li>
 						<span class="option">remove alternative fonts to woff/otf and unused fonts</span>
 						<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
 						<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
 						<p class="notice">It is recommended to
 							<u>check</u> this option</p>
 							<u>check</u> this option</p>
 					</li>
 					</li>
@@ -284,8 +284,7 @@
 					<li>
 					<li>
 						<span class="option">remove stylesheets for alternative devices to screens</span>
 						<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
 						<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>
 					</li>
 				</ul>
 				</ul>
 				<p>Other resources</p>
 				<p>Other resources</p>

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

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