kopia lustrzana https://github.com/backface/turtlestitch
extensions: tweaked loading unlisted script-extensions
rodzic
65e9c4587a
commit
e20d304bc5
|
@ -10,6 +10,9 @@
|
|||
* **Notable Fixes:**
|
||||
* fixed occasional invisible error messages
|
||||
|
||||
### 2021-06-24
|
||||
* extensions: tweaked loading unlisted script-extensions
|
||||
|
||||
### 2021-06-23
|
||||
* updated bignums library
|
||||
* pushed dev version to 6.10
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<script src="src/sketch.js?version=2020-07-13"></script>
|
||||
<script src="src/video.js?version=2019-06-27"></script>
|
||||
<script src="src/maps.js?version=2021-06-15"></script>
|
||||
<script src="src/extensions.js?version=2021-06-23"></script>
|
||||
<script src="src/extensions.js?version=2021-06-24"></script>
|
||||
<script src="src/xml.js?version=2020-04-27"></script>
|
||||
<script src="src/store.js?version=2021-06-10"></script>
|
||||
<script src="src/locale.js?version=2021-06-11"></script>
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
/*global modules, List, StageMorph, Costume, SpeechSynthesisUtterance, Sound,
|
||||
IDE_Morph, CamSnapshotDialogMorph, SoundRecorderDialogMorph, isSnapObject, nop,
|
||||
Color, contains*/
|
||||
Color, Process, contains*/
|
||||
|
||||
modules.extensions = '2021-June-23';
|
||||
modules.extensions = '2021-June-24';
|
||||
|
||||
// Global stuff
|
||||
|
||||
|
@ -691,23 +691,28 @@ SnapExtensions.primitives.set(
|
|||
if (contains(SnapExtensions.scripts, url)) {
|
||||
return;
|
||||
}
|
||||
if (!(SnapExtensions.urls.some(any => url.indexOf(any) === 0))) {
|
||||
throw new Error('unlisted extension url:\n"' + url + '"');
|
||||
if (Process.prototype.enableJS || SnapExtensions.urls.some(
|
||||
any => url.indexOf(any) === 0)
|
||||
) {
|
||||
scriptElement = document.createElement('script');
|
||||
scriptElement.onload = () => {
|
||||
SnapExtensions.scripts.push(url);
|
||||
proc.context.accumulator.done = true;
|
||||
};
|
||||
document.head.appendChild(scriptElement);
|
||||
scriptElement.src = url;
|
||||
} else {
|
||||
throw new Error(
|
||||
'unlisted extension url:\n"' + url + '"\n' +
|
||||
'JavaScript extensions for Snap!\nare turned off'
|
||||
);
|
||||
}
|
||||
scriptElement = document.createElement('script');
|
||||
scriptElement.onload = () => {
|
||||
SnapExtensions.scripts.push(url);
|
||||
proc.context.accumulator.done = true;
|
||||
};
|
||||
document.head.appendChild(scriptElement);
|
||||
scriptElement.src = url;
|
||||
} else if (proc.context.accumulator.done) {
|
||||
return;
|
||||
}
|
||||
proc.pushContext('doYield');
|
||||
proc.pushContext();
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// Menus
|
||||
|
|
Ładowanie…
Reference in New Issue