Skip to content

Commit b5ab85b

Browse files
authored
Merge pull request #574 from cicerorph/patch-14
Fix mCompiler errors
2 parents 677430e + 28a85f6 commit b5ab85b

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

static/extensions/MubiLop/authpenguin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@
241241
}
242242
}
243243

244-
setServerUrl(args) {
244+
async setServerUrl(args) {
245+
if (await Scratch.canFetch(args.URL) === false) return;
245246
this.serverUrl = args.URL;
246247
}
247248

static/extensions/MubiLop/spritesheeter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
}
4545

4646
loadImage(url) {
47+
if (await Scratch.canFetch(url) === false) return;
48+
4749
return new Promise((resolve, reject) => {
4850
const img = new Image();
4951
img.crossOrigin = "anonymous"; // Add CORS support

static/extensions/MubiLop/toastnotifs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@
551551
}
552552

553553
// general function so its better to handle things
554-
_createToast(options) {
554+
async _createToast(options) {
555555
const container = createToastContainer(options.position);
556556
const toast = document.createElement('div');
557557
toast.className = 'toast';
@@ -578,13 +578,15 @@
578578
toast.style.transform = `translateY(${stackSize * 100}%)`;
579579
toast.style.transition = 'transform 0.3s ease-out';
580580

581-
if (options.image) {
581+
if (options.image && await Scratch.canFetch(options.image)) {
582582
const img = document.createElement('img');
583583
img.src = options.image;
584584
img.alt = 'Toast icon';
585+
585586
if (options.imageRounded) {
586587
img.style.borderRadius = '50%';
587588
}
589+
588590
toast.appendChild(img);
589591
}
590592

static/extensions/MubiLop/yeetyourfiles.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,8 @@
13641364
try {
13651365
this.uploadStatus = 'uploading';
13661366
this.uploadSuccessful = false;
1367+
1368+
if (await Scratch.canFetch(url) === false) throw new Error('User denied the fetch of the file on the external url');
13671369

13681370
const response = await fetch(url);
13691371
if (!response.ok) {

0 commit comments

Comments
 (0)