Преглед изворни кода

yet another (stange) fix for Firefox

Gildas пре 7 година
родитељ
комит
9b1e124769
2 измењених фајлова са 5 додато и 16 уклоњено
  1. 2 2
      extension/ui/scripts/content/ui.js
  2. 3 14
      lib/single-file/parse-srcset.js

+ 2 - 2
extension/ui/scripts/content/ui.js

@@ -18,9 +18,9 @@
  *   along with SingleFile.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* global singlefile, document */
+/* global document */
 
-singlefile.ui = (() => {
+this.singlefile.ui = (() => {
 
 	const MASK_TAGNAME = "singlefile-mask";
 

+ 3 - 14
lib/single-file/parse-srcset.js

@@ -14,19 +14,7 @@
  * (except for comments in parens).
  */
 
-/* global window */
-
-(function (root, factory) {
-	if (typeof module === "object" && module.exports) {
-		// Node. Does not work with strict CommonJS, but
-		// only CommonJS-like environments that support module.exports,
-		// like Node.
-		module.exports = factory();
-	} else {
-		// Browser globals (root is window)
-		root.parseSrcset = factory();
-	}
-}(window, function () {
+this.parseSrcset = (() => {
 
 	// 1. Let input be the value passed to this algorithm.
 	return function (input) {
@@ -327,4 +315,5 @@
 		} // (close parseDescriptors fn)
 
 	};
-}));
+
+})();