diff --git a/build-bookmarklet.sh b/build-bookmarklet.sh index 24cd402..b0bc38b 100755 --- a/build-bookmarklet.sh +++ b/build-bookmarklet.sh @@ -26,13 +26,14 @@ if [ ! -f "$CSS_FILE" ]; then echo "ERROR: $CSS_FILE not found"; exit 1; fi if [ ! -f "$JS_FILE" ]; then echo "ERROR: $JS_FILE not found"; exit 1; fi if [ ! -f "$FAVICON_FILE" ]; then echo "ERROR: $FAVICON_FILE not found"; exit 1; fi -# Favicon URL (served from GitHub raw) -FAVICON_URL="https://raw.githubusercontent.com/TauNeutrino/kantine-overview/main/favicon.png" +# Generate favicon Base64 data URI from PNG +FAVICON_B64=$(base64 -w0 "$FAVICON_FILE") +FAVICON_URL="data:image/png;base64,${FAVICON_B64}" CSS_CONTENT=$(cat "$CSS_FILE") -# Inject version into JS -JS_CONTENT=$(cat "$JS_FILE" | sed "s|{{VERSION}}|$VERSION|g") +# Inject version and favicon into JS +JS_CONTENT=$(cat "$JS_FILE" | sed "s|{{VERSION}}|$VERSION|g" | sed "s|{{FAVICON_DATA_URI}}|$FAVICON_URL|g") # === 1. Build standalone HTML (for local testing/dev) === cat > "$DIST_DIR/kantine-standalone.html" << HTMLEOF @@ -206,9 +207,9 @@ echo "document.getElementById('bookmarklet-link').href = " >> "$DIST_DIR/install echo "$JS_CONTENT" | python3 -c " import sys, json, urllib.parse -# 1. Read JS and Replace VERSION +# 1. Read JS and Replace VERSION + Favicon js_template = sys.stdin.read() -js = js_template.replace('{{VERSION}}', '$VERSION') +js = js_template.replace('{{VERSION}}', '$VERSION').replace('{{FAVICON_DATA_URI}}', '$FAVICON_URL') # 2. Prepare CSS for injection via createElement('style') css = open('$CSS_FILE').read().replace('\n', ' ').replace(' ', ' ') diff --git a/changelog.md b/changelog.md index 64ba8aa..d82c52e 100755 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## v1.4.27 +- 🔧 **Build**: Favicon wird jetzt sauber aus `favicon.png` per Build-Script als PNG-Base64-Data-URI generiert und über `{{FAVICON_DATA_URI}}` Platzhalter in `kantine.js` + `install.html` injiziert. Funktioniert auf allen Browsern und Proxy-Diensten. + ## v1.4.26 - 🎨 **Favicon**: Von SVG-Base64 auf PNG-Datei (`favicon.png`) umgestellt, verlinkt via raw.githubusercontent.com. Funktioniert zuverlässig auf allen Browsern und Proxy-Diensten (htmlpreview.github.io). diff --git a/kantine.js b/kantine.js index 661cce5..44d888e 100755 --- a/kantine.js +++ b/kantine.js @@ -57,7 +57,7 @@ const favicon = document.createElement('link'); favicon.rel = 'icon'; favicon.type = 'image/png'; - favicon.href = 'https://raw.githubusercontent.com/TauNeutrino/kantine-overview/main/favicon.png'; + favicon.href = '{{FAVICON_DATA_URI}}'; document.head.appendChild(favicon); // Inject Google Fonts if not already present diff --git a/version.txt b/version.txt index 48259a7..fd51d23 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v1.4.26 +v1.4.27