Explorar o código

added constant

Former-commit-id: 16096c39c722de0c8dcedcff5704c3d339da7ca8
Gildas %!s(int64=5) %!d(string=hai) anos
pai
achega
b4980ff68b
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      lib/single-file/single-file-core.js

+ 3 - 2
lib/single-file/single-file-core.js

@@ -390,6 +390,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 	const SHADOW_MODE_ATTRIBUTE_NAME = "shadowmode";
 	const SHADOW_DELEGATE_FOCUS_ATTRIBUTE_NAME = "delegatesfocus";
 	const SCRIPT_TEMPLATE_SHADOW_ROOT = "data-template-shadow-root";
+	const UTF8_CHARSET = "utf-8";
 
 	class Processor {
 		constructor(options, batchRequest) {
@@ -730,7 +731,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 				element.remove();
 			});
 			const metaElement = this.doc.createElement("meta");
-			metaElement.setAttribute("charset", "utf-8");
+			metaElement.setAttribute("charset", UTF8_CHARSET);
 			if (this.doc.head.firstChild) {
 				this.doc.head.insertBefore(metaElement, this.doc.head.firstChild);
 			} else {
@@ -1172,7 +1173,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 					this.stats.add("processed", "scripts", 1);
 					const content = await util.getContent(resourceURL, {
 						asBinary: true,
-						charset: this.charset != "utf-8" && this.charset,
+						charset: this.charset != UTF8_CHARSET && this.charset,
 						maxResourceSize: this.options.maxResourceSize,
 						maxResourceSizeEnabled: this.options.maxResourceSizeEnabled,
 						frameId: this.options.windowId