Merge pull request #299 from TurboWarp/face-sensing

Add face sensing to default extension URLs
This commit is contained in:
Thomas Weber authored and GitHub committed 2025-10-07 18:12:47 -05:00
commit 2ee8d6cf6b
2 files changed
+14 -8

No files matched your search

@@ -1,15 +1,18 @@
// If a project uses an extension but does not specify a URL, it will default to
// the URLs given here, if it exists. This is useful for compatibility with other mods.
const defaults = new Map();
const defaults = {
// Box2D (`griffpatch`) is not listed here because our extension is not actually
// compatible with the original version due to fields vs inputs.
// Box2D (`griffpatch`) is not listed here because our extension is not actually
// compatible with the original version due to fields vs inputs.
// Scratch Lab Animated Text - https://lab.scratch.mit.edu/text/
text: 'https://extensions.turbowarp.org/lab/text.js',
// Scratch Lab Animated Text - https://lab.scratch.mit.edu/text/
defaults.set('text', 'https://extensions.turbowarp.org/lab/text.js');
// Turboloader's AudioStream
audiostr: 'https://extensions.turbowarp.org/turboloader/audiostream.js',
// Turboloader's AudioStream
defaults.set('audiostr', 'https://extensions.turbowarp.org/turboloader/audiostream.js');
// https://scratch.mit.edu/discuss/topic/842592/
faceSensing: 'https://extensions.turbowarp.org/lab/face-sensing.js'
};
module.exports = defaults;
+4 -1
View File
@@ -779,7 +779,10 @@ class VirtualMachine extends EventEmitter {
this.extensionManager.loadExtensionIdSync(extensionID);
} else {
// Custom extension
const url = extensionURLs.get(extensionID) || defaultExtensionURLs.get(extensionID);
let url = extensionURLs.get(extensionID);
if (!url && Object.prototype.hasOwnProperty.call(defaultExtensionURLs, extensionID)) {
url = defaultExtensionURLs[extensionID];
}
if (!url) {
throw new Error(`Unknown extension: ${extensionID}`);
}