black-backdoor / MeOS

Online Operating System
https://meos.lima.zone
GNU General Public License v3.0
1 stars 1 forks source link

[Bug] Elements Inside `<body>` Instead of `<head>` #73

Closed black-backdoor closed 2 months ago

black-backdoor commented 2 months ago

What browsers are you seeing the problem on?

Firefox, Chrome

Description

There is a bug in the code that causes all elements after the first <idle-resource> tag to be moved from <head> to <body>. This results in incorrect HTML structure, as shown below:

<!-- Incorrect HTML structure -->
</head><body><idle-resource src="/assets/connection/no-wifi.svg" type="image"></idle-resource>
<script src="/components/applet/wifi.js" type="module"></script>
<script src="/components/applet/battery.js" type="module"></script>

Steps to Reproduce

visit /

Screenshots

image

Logs

_____     _____ _____ 
|     |___|     |   __|
| | | | -_|  |  |__   |
|_|_|_|___|_____|_____| 

Version: 3.18.3 
Made by @black-backdoor

welcome.js:1:9
[idle-resource] Using requestIdleCallback idle-resources.js:33:13
[preloadImages] Preloading offline image wifi.js:21:17
[setBatteryStatus] battery status is not supported battery.js:179:21
[PWA] Service Worker is not supported in this browser register.js:14:13
[NETWORK] Using requestIdleCallback network.js:39:17
[idle-resource] Loading idle resources idle-resources.js:17:13
[idle-resource] Found 6 resources idle-resources.js:19:13
[idle-resource] preloading 6 resources idle-resources.js:20:13
Loading image: /assets/connection/no-wifi.svg idle-resources.js:9:21
Loading image: /assets/sound/speaker-muted.svg idle-resources.js:9:21
Loading image: /assets/sound/speaker-1.svg idle-resources.js:9:21
Loading image: /assets/sound/speaker-2.svg idle-resources.js:9:21
Loading image: /assets/sound/speaker-3.svg idle-resources.js:9:21
Loading image: /assets/sound/speaker.svg idle-resources.js:9:21
[NETWORK] Network Information API not supported network.js:33:17
[setWifiStatus] set Wifi to connected wifi.js:34:25
[PWA] Service Worker is not supported in this browser register.js:14:13
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. stylesheets-manager.js:664:11
[PERFORMANCE] Network Resources: img performance.js:2:13
[PERFORMANCE] Network Resources: link performance.js:2:13
[PERFORMANCE] Network Resources: script performance.js:2:13
[PERFORMANCE] Network Resources: iframe performance.js:2:13
save notifications <notifications-app name="MeOS" icon="/favicon.ico"><desktop-notification name="Welcome to MeOS!" content="This is a simple operating system built with HTML, CSS, and JavaScript." app-name="MeOS" app-icon="/favicon.ico"></desktop-notification></notifications-app> 2 notifications.js:19:13

Additional Context

No response