Explorar el Código

add missing extension/index.js file

Gildas hace 5 años
padre
commit
67f7bfe978

+ 1 - 0
extension/core/bg/business.js

@@ -37,6 +37,7 @@ singlefile.extension.core.bg.business = (() => {
 	const extensionScriptFiles = [
 		"common/index.js",
 		"common/ui/content/content-infobar.js",
+		"extension/index.js",
 		"extension/lib/single-file/index.js",
 		"extension/core/index.js",
 		"extension/ui/index.js",

+ 27 - 0
extension/index.js

@@ -0,0 +1,27 @@
+/*
+ * 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.extension = this.singlefile.extension || {
+	injectScript: (tabId, options) => this.singlefile.extension.lib.core.bg.scripts.inject(tabId, options),
+	getPageData: (options, doc, win, initOptions = { fetch: this.singlefile.extension.lib.fetch.content.resources.fetch }) => this.singlefile.lib.getPageData(options, initOptions, doc, win)
+};

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

@@ -50,6 +50,7 @@ singlefile.extension.lib.core.bg.scripts = (() => {
 		"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",
 		"extension/lib/single-file/index.js",
 		"extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js",
 		"extension/lib/single-file/fetch/content/content-fetch.js",
@@ -61,6 +62,7 @@ singlefile.extension.lib.core.bg.scripts = (() => {
 		"lib/single-file/vendor/css-unescape.js",
 		"lib/single-file/processors/hooks/content/content-hooks-frames.js",
 		"lib/single-file/processors/frame-tree/content/content-frame-tree.js",
+		"extension/index.js",
 		"extension/lib/single-file/index.js",
 		"extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js",
 		"extension/lib/single-file/fetch/content/content-fetch.js"

+ 13 - 17
extension/lib/single-file/index.js

@@ -21,22 +21,18 @@
  *   Source.
  */
 
-this.singlefile.extension = this.singlefile.extension || {
-	lib: {
-		core: {
-			bg: {}
-		},
-		fetch: {
-			bg: {},
-			content: {}
-		},
-		frameTree: {
-			bg: {}
-		},
-		lazy: {
-			bg: {}
-		}
+this.singlefile.extension.lib = this.singlefile.extension.lib || {
+	core: {
+		bg: {}
 	},
-	injectScript: (tabId, options) => this.singlefile.extension.lib.core.bg.scripts.inject(tabId, options),
-	getPageData: (options, doc, win, initOptions = { fetch: this.singlefile.extension.lib.fetch.content.resources.fetch }) => this.singlefile.lib.getPageData(options, initOptions, doc, win)
+	fetch: {
+		bg: {},
+		content: {}
+	},
+	frameTree: {
+		bg: {}
+	},
+	lazy: {
+		bg: {}
+	}
 };

+ 3 - 0
manifest.json

@@ -18,6 +18,7 @@
 			"run_at": "document_start",
 			"js": [
 				"lib/single-file/index.js",
+				"extension/index.js",
 				"extension/lib/single-file/index.js",
 				"extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js",
 				"lib/single-file/single-file-helper.js",
@@ -45,6 +46,7 @@
 				"lib/single-file/index.js",
 				"lib/single-file/processors/hooks/content/content-hooks.js",
 				"lib/single-file/modules/html-serializer.js",
+				"extension/index.js",
 				"extension/lib/single-file/index.js",
 				"extension/core/index.js",
 				"extension/core/content/content-bootstrap.js"
@@ -54,6 +56,7 @@
 	"background": {
 		"scripts": [
 			"lib/single-file/index.js",
+			"extension/index.js",
 			"extension/lib/single-file/index.js",
 			"extension/core/index.js",
 			"extension/ui/index.js",