fix(share): Threads-Unicode + Instagram-Dialog macOS (#178)
Threads-Encoding: rendered Sonderzeichen als ? oder Rauten, weil der
Text mit zerlegten Codepoints (z.B. ``a`` + Combining Diaeresis statt
``ä``) ankam — Threads' Composer kommt damit nicht klar. Fix: NFC-
Normalisierung (``str.normalize('NFC')``) vor encodeURIComponent. Das
vereinigt zerlegte Umlaute und typografische Anführungszeichen.
Instagram-Share auf macOS: bisher versuchten wir auch auf Desktop den
``navigator.share()``-Pfad mit File. Das öffnet das macOS-Share-Sheet,
zeigt aber nur AirDrop / Mail / Notizen — Instagram-App ist auf Desktop
nicht installiert, also nutzlos. Fix: Mobile-Detection via User-Agent
+ maxTouchPoints (für iPad-iOS-13+-Maskierung). Auf Desktop direkt zu
Pfad B (Download + Clipboard) statt OS-Sheet.
This commit is contained in:
parent
1a3aa9bbcb
commit
61c39eb820
@ -914,7 +914,12 @@ window.v2ShowMatrixFieldInfo = function(field) {
|
|||||||
if (!win) v2ShareToast('Bitte Pop-up-Blocker prüfen — LinkedIn-Tab konnte nicht geöffnet werden.');
|
if (!win) v2ShareToast('Bitte Pop-up-Blocker prüfen — LinkedIn-Tab konnte nicht geöffnet werden.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var text = buildShareText(platform) + '\n' + PERMALINK;
|
// NFC-Normalisierung: typografische Anführungszeichen + Umlaute werden
|
||||||
|
// mancherorts als zerlegte Codepoints (z.B. "a" + Combining Diaeresis)
|
||||||
|
// angeliefert. Threads' Composer rendert die zerlegten Formen als
|
||||||
|
// Rauten / ?#. NFC vereinigt sie zu "ä".
|
||||||
|
var rawText = buildShareText(platform) + '\n' + PERMALINK;
|
||||||
|
var text = rawText.normalize ? rawText.normalize('NFC') : rawText;
|
||||||
var urls = {
|
var urls = {
|
||||||
threads: 'https://www.threads.net/intent/post?text=' + encodeURIComponent(text),
|
threads: 'https://www.threads.net/intent/post?text=' + encodeURIComponent(text),
|
||||||
};
|
};
|
||||||
@ -993,8 +998,20 @@ window.v2ShowMatrixFieldInfo = function(field) {
|
|||||||
var safeDrs = (DRS || 'antrag').replace(/[^a-zA-Z0-9_-]/g, '-');
|
var safeDrs = (DRS || 'antrag').replace(/[^a-zA-Z0-9_-]/g, '-');
|
||||||
var filename = 'gwoe-' + safeDrs + '.png';
|
var filename = 'gwoe-' + safeDrs + '.png';
|
||||||
|
|
||||||
// Pfad A — Web-Share mit Datei (nur Mobile)
|
// Pfad A — Web-Share mit Datei nur auf Mobile, weil der OS-Share-Sheet
|
||||||
if (navigator.canShare && navigator.share) {
|
// unter macOS Safari/Chrome eine schlechte UX liefert (Instagram-App
|
||||||
|
// ist nicht installiert auf Desktop, das Sheet zeigt nur AirDrop, Mail
|
||||||
|
// und Notizen). Mobile-Detection per User-Agent und maxTouchPoints —
|
||||||
|
// eine reine Touch-Erkennung würde Hybrid-Geräte falsch klassifizieren.
|
||||||
|
var isMobile = (function () {
|
||||||
|
var ua = navigator.userAgent || '';
|
||||||
|
if (/Android|iPhone|iPad|iPod|Mobile/i.test(ua)) return true;
|
||||||
|
// iPad iOS 13+ tarnt sich als macOS — Touch-Support als Hint.
|
||||||
|
if (/Macintosh/.test(ua) && navigator.maxTouchPoints > 1) return true;
|
||||||
|
return false;
|
||||||
|
})();
|
||||||
|
|
||||||
|
if (isMobile && navigator.canShare && navigator.share) {
|
||||||
try {
|
try {
|
||||||
var resp = await fetch(url);
|
var resp = await fetch(url);
|
||||||
if (resp.ok) {
|
if (resp.ok) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user