Comparing version 1.2.0 to 1.2.1
16
lzma.js
/// This code is licensed under the MIT License. See LICENSE for more details. | ||
/// Does the environment support web workers? If not, let's fake it. | ||
if (!Worker) { | ||
///NOTE: Since web workers don't work when a page is loaded from the local system, we have to fake it there too. (Take that security measures!) | ||
if (!Worker || (location && location.protocol === "file:")) { | ||
///NOTE: IE8 and IE9 needs onmessage to be created first, IE7- do not care. | ||
@@ -31,3 +32,3 @@ ///NOTE: Because IE9 implements part of the Web Worker's spec, postMessage() must be overwritten. | ||
script_tag.src = path; | ||
document.getElementsByTagName('head')[0].appendChild(script_tag); | ||
document.getElementsByTagName("head")[0].appendChild(script_tag); | ||
}; | ||
@@ -41,8 +42,13 @@ } | ||
return_object.postMessage = function (message) { | ||
/// Delay the call just in case the "worker" script has not had time to load. | ||
setTimeout(function () { | ||
/// Has the worker script loaded yet? | ||
if (global_var.onmessage) { | ||
/// Call the global onmessage() created by the "worker." | ||
///NOTE: Wrap the message in an object. | ||
global_var.onmessage({data: message}); | ||
}, 10); | ||
} else { | ||
/// Since the script has not yet loaded, wait a moment, and then retry. | ||
setTimeout(function () { | ||
return_object.postMessage(message); | ||
}, 50); | ||
} | ||
}; | ||
@@ -49,0 +55,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "A standalone JavaScript implementation of the Lempel-Ziv-Markov chain (LZMA) compression algorithm", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"homepage": "https://github.com/nmrugg/LZMA-JS", | ||
@@ -8,0 +8,0 @@ "repository": { |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
130681
3607
0
1