fix: defer favicon injection with setTimeout for htmlpreview compat (v1.4.29)
This commit is contained in:
@@ -243,13 +243,16 @@ $CHANGELOG_HTML
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat >> "$DIST_DIR/install.html" << INSTALLEOF
|
cat >> "$DIST_DIR/install.html" << INSTALLEOF
|
||||||
// Dynamic favicon injection (overrides proxy defaults like htmlpreview.github.io)
|
// Dynamic favicon injection — setTimeout ensures it runs AFTER
|
||||||
document.querySelectorAll('link[rel*="icon"]').forEach(function(el) { el.remove(); });
|
// htmlpreview.github.io's document.write() processing completes
|
||||||
var fi = document.createElement('link');
|
setTimeout(function() {
|
||||||
fi.rel = 'icon';
|
document.querySelectorAll('link[rel*="icon"]').forEach(function(el) { el.remove(); });
|
||||||
fi.type = 'image/png';
|
var fi = document.createElement('link');
|
||||||
fi.href = '$FAVICON_URL';
|
fi.rel = 'icon';
|
||||||
document.head.appendChild(fi);
|
fi.type = 'image/png';
|
||||||
|
fi.href = '$FAVICON_URL';
|
||||||
|
document.head.appendChild(fi);
|
||||||
|
}, 0);
|
||||||
document.getElementById('bookmarklet-link').textContent = 'Kantine $VERSION';
|
document.getElementById('bookmarklet-link').textContent = 'Kantine $VERSION';
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
## v1.4.29
|
||||||
|
- 🐛 **Bugfix**: Favicon-Injection in `install.html` mit `setTimeout(0)` verzögert, sodass sie nach dem `document.write()` von htmlpreview.github.io läuft. Chrome erkennt Favicon-Änderungen erst im nächsten Event-Loop-Tick.
|
||||||
|
|
||||||
## v1.4.28
|
## v1.4.28
|
||||||
- 🎨 **Favicon**: Eigenes Favicon-Design aus `favicon_base.png` (2048x2048) auf 32x32 skaliert. Wird beim Build automatisch als PNG-Data-URI in Bookmarklet und Installer injiziert.
|
- 🎨 **Favicon**: Eigenes Favicon-Design aus `favicon_base.png` (2048x2048) auf 32x32 skaliert. Wird beim Build automatisch als PNG-Data-URI in Bookmarklet und Installer injiziert.
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v1.4.28
|
v1.4.29
|
||||||
|
|||||||
Reference in New Issue
Block a user