Sfoglia il codice sorgente

remove "main" namespace

Gildas 5 anni fa
parent
commit
251aefa1ba

+ 0 - 1
cli/back-ends/common/scripts.js

@@ -50,7 +50,6 @@ const SCRIPTS = [
 	"lib/single-file/modules/html-images-alt-minifier.js",
 	"lib/single-file/modules/html-serializer.js",
 	"lib/single-file/single-file-core.js",
-	"lib/single-file/single-file.js",
 	"common/ui/content/content-infobar.js"
 ];
 

+ 1 - 1
extension/core/content/content-main.js

@@ -32,7 +32,7 @@ this.extension.core.content.main = this.extension.core.content.main || (() => {
 
 	let ui, processor;
 
-	singlefile.lib.main.init({
+	singlefile.lib.init({
 		fetch: extension.lib.fetch.content.resources.fetch,
 		frameFetch: extension.lib.fetch.content.resources.frameFetch
 	});

+ 0 - 1
extension/lib/single-file/core/bg/scripts.js

@@ -47,7 +47,6 @@ extension.lib.core.bg.scripts = (() => {
 		"lib/single-file/single-file-util.js",
 		"lib/single-file/single-file-helper.js",
 		"lib/single-file/single-file-core.js",
-		"lib/single-file/single-file.js",
 		"lib/single-file/processors/lazy/content/content-lazy-loader.js",
 		"lib/single-file/processors/hooks/content/content-hooks.js",
 		"extension/index.js",

+ 5 - 1
lib/single-file/index.js

@@ -25,6 +25,10 @@
 
 this.singlefile = this.singlefile || {
 	lib: {
+		init(initOptions) {
+			const util = this.util.getInstance(initOptions);
+			this.SingleFile = this.core.getClass(util, this.vendor.cssTree);
+		},
 		processors: {
 			frameTree: {
 				content: {}
@@ -41,7 +45,7 @@ this.singlefile = this.singlefile || {
 		async getPageData(options = {}, initOptions, doc = window.document, win = window) {
 			const frames = this.processors.frameTree.content.frames;
 			let framesSessionId;
-			this.main.init(initOptions);
+			this.init(initOptions);
 			if (doc && window) {
 				this.helper.initDoc(doc);
 				const preInitializationPromises = [];

+ 0 - 37
lib/single-file/single-file.js

@@ -1,37 +0,0 @@
-/*
- * Copyright 2010-2020 Gildas Lormeau
- * contact : gildas.lormeau <at> gmail.com
- * 
- * This file is part of SingleFile.
- *
- *   The code in this file is free software: you can redistribute it and/or 
- *   modify it under the terms of the GNU Affero General Public License 
- *   (GNU AGPL) as published by the Free Software Foundation, either version 3
- *   of the License, or (at your option) any later version.
- * 
- *   The code in this file is distributed in the hope that it will be useful, 
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of 
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero 
- *   General Public License for more details.
- *
- *   As additional permission under GNU AGPL version 3 section 7, you may 
- *   distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU 
- *   AGPL normally required by section 4, provided you include this license 
- *   notice and a URL through which recipients can access the Corresponding 
- *   Source.
- */
-
-this.singlefile.lib.main = this.singlefile.lib.main || (() => {
-
-	const singlefile = this.singlefile;
-
-	return {
-		init
-	};
-
-	function init(initOptions) {
-		const util = singlefile.lib.util.getInstance(initOptions);
-		singlefile.lib.SingleFile = singlefile.lib.core.getClass(util, singlefile.lib.vendor.cssTree);
-	}
-
-})();

+ 1 - 2
manifest.json

@@ -78,8 +78,7 @@
 			"lib/single-file/modules/html-minifier.js",
 			"lib/single-file/modules/html-serializer.js",
 			"lib/single-file/modules/html-images-alt-minifier.js",
-			"lib/single-file/single-file-core.js",
-			"lib/single-file/single-file.js",
+			"lib/single-file/single-file-core.js",			
 			"common/index.js",
 			"common/ui/content/content-infobar.js",
 			"extension/lib/single-file/core/bg/scripts.js",