I was testing bundling up a single-file HTML webapp with html-lnline, and found a couple spots where Chrome can't load gss.js if its contents are in <script> tags inline:
Engine.prototype.getWorkerURL = (function() {
var scripts, src;
if (typeof document !== "undefined" && document !== null) {
scripts = document.getElementsByTagName('script');
src = scripts[scripts.length - 1].src;
if (!src.match(/gss/i)) {
scripts = document.querySelectorAll('script[src*=gss]')[0];
if (scripts && scripts.hasOwnProperty('length')) { // MODIFIED HERE: threw error because scripts was undefined
src = scripts[0].src;
}
}
}
return function(url) {
if (typeof url !== 'string') {
url = src;
}
if (!url) {throw new Error("Can not detect GSS source file");} // MODIFIED HERE: some ILLEGAL character was appearing
return url;
};
})();
html-inline was otherwise faithful in inserting the script; fixing the above two lines in the bundled HTML file resulted in a working bundle.
I was testing bundling up a single-file HTML webapp with html-lnline, and found a couple spots where Chrome can't load
gss.js
if its contents are in<script>
tags inline:html-inline was otherwise faithful in inserting the script; fixing the above two lines in the bundled HTML file resulted in a working bundle.