Skip to content

Commit de26b54

Browse files
committed
hide custom fullscreen button on itchio
1 parent 57ce97e commit de26b54

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/emscripten.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- master
7-
# - develop
7+
- develop
88
tags:
99
- "v*"
1010
pull_request:

src/template/body.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,21 @@
171171
const canvas = document.getElementById('canvas');
172172
const fsBtn = document.getElementById('fs-btn');
173173

174+
175+
// Wait a bit for itch.io to inject their UI
176+
setTimeout(() => {
177+
// Check if itch.io's fullscreen button exists
178+
const itchFsBtn = document.querySelector('.icon-fullscreen') ||
179+
document.querySelector('[title*="fullscreen"]') ||
180+
(window.self !== window.top);
181+
182+
if (itchFsBtn || window.self !== window.top) {
183+
fsBtn.style.display = 'none';
184+
console.log("itch.io detected - hiding custom fullscreen button");
185+
}
186+
}, 500);
187+
188+
174189
// Define your game's aspect ratio (adjust these values to match your game)
175190
const GAME_WIDTH = 640;
176191
const GAME_HEIGHT = 480;

0 commit comments

Comments
 (0)