diff --git a/birb.js b/birb.js index 7d622f7..f0360c1 100644 --- a/birb.js +++ b/birb.js @@ -443,6 +443,8 @@ function loadSpriteSheetPixels(dataUri, templateColors = true) { }); } +log("Loading sprite sheets..."); + // @ts-ignore Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATIONS_SPRITE_SHEET, false), loadSpriteSheetPixels(FEATHER_SPRITE_SHEET)]).then(([birbPixels, decorationPixels, featherPixels]) => { const SPRITE_SHEET = birbPixels; @@ -924,8 +926,10 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI function init() { if (window !== window.top) { // Skip installation if within an iframe + log("In iframe, skipping Birb script initialization"); return; } + log("Sprite sheets loaded successfully, initializing bird..."); // Preload font const MONOCRAFT_SRC = "https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf"; @@ -1834,6 +1838,8 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI } canvas.style.bottom = `${bottom}px`; } +}).catch((e) => { + error("Error while loading sprite sheets: ", e); }); /** diff --git a/dist/birb.js b/dist/birb.js index 71a3f0d..911be04 100644 --- a/dist/birb.js +++ b/dist/birb.js @@ -786,6 +786,8 @@ function loadSpriteSheetPixels(dataUri, templateColors = true) { }); } +log("Loading sprite sheets..."); + // @ts-ignore Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATIONS_SPRITE_SHEET, false), loadSpriteSheetPixels(FEATHER_SPRITE_SHEET)]).then(([birbPixels, decorationPixels, featherPixels]) => { const SPRITE_SHEET = birbPixels; @@ -1267,8 +1269,10 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI function init() { if (window !== window.top) { // Skip installation if within an iframe + log("In iframe, skipping Birb script initialization"); return; } + log("Sprite sheets loaded successfully, initializing bird..."); // Preload font const MONOCRAFT_SRC = "https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf"; @@ -2177,6 +2181,8 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI } canvas.style.bottom = `${bottom}px`; } +}).catch((e) => { + error("Error while loading sprite sheets: ", e); }); /** diff --git a/dist/birb.user.js b/dist/birb.user.js index 5484341..3736584 100644 --- a/dist/birb.user.js +++ b/dist/birb.user.js @@ -800,6 +800,8 @@ function loadSpriteSheetPixels(dataUri, templateColors = true) { }); } +log("Loading sprite sheets..."); + // @ts-ignore Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATIONS_SPRITE_SHEET, false), loadSpriteSheetPixels(FEATHER_SPRITE_SHEET)]).then(([birbPixels, decorationPixels, featherPixels]) => { const SPRITE_SHEET = birbPixels; @@ -1281,8 +1283,10 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI function init() { if (window !== window.top) { // Skip installation if within an iframe + log("In iframe, skipping Birb script initialization"); return; } + log("Sprite sheets loaded successfully, initializing bird..."); // Preload font const MONOCRAFT_SRC = "https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf"; @@ -2191,6 +2195,8 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI } canvas.style.bottom = `${bottom}px`; } +}).catch((e) => { + error("Error while loading sprite sheets: ", e); }); /** diff --git a/manifest.json b/manifest.json index 9399648..cd3e701 100644 --- a/manifest.json +++ b/manifest.json @@ -1,13 +1,13 @@ { "manifest_version": 3, - "name": "Browser Bird", + "name": "Pocket Bird", "description": "It's a bird, in your browser. What more could you want?", "version": "2025.9.16.1", "homepage_url": "https://idreesinc.com", "content_scripts": [ { "matches": [""], - "js": ["birb.js"] + "js": ["./dist/birb.js"] } ], "permissions": [