ζ-1 Polish: robuster Header-Selektor + zitare.mana.how als 2. UL-Domain
- WebShellScripts.hideWebHeader: drei Selektor-Strategien gestapelt (data-app-nav-Marker / strukturell via :has(a.brand) / positionell via :first-of-type), damit Klassen-Renames in zitare-web das Hide nicht still brechen - project.yml entitlements: applinks:zitare.mana.how als zweite Universal-Link-Domain, solange zitare.com-DNS-Zone fehlt. Beide Hosts liefern dasselbe AASA-File. Nach Cloudflare-Cut kann der Eintrag bleiben — schadet nicht - Live-E2E verifiziert: simctl openurl https://zitare.mana.how/q/... → App empfängt Deep-Link, WebShell lädt die Quote-Page, native TabBar bleibt, Web-Header bleibt versteckt Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c89d48c6f6
commit
03e2f041e5
3 changed files with 35 additions and 5 deletions
|
|
@ -14,10 +14,32 @@ enum WebShellScripts {
|
|||
///
|
||||
/// CSS wird at document.start als `<style>`-Tag injiziert — vor dem
|
||||
/// First Paint, kein Flicker.
|
||||
/// Mehrere Selektor-Strategien stapeln, damit ein Klassen-Rename
|
||||
/// oder Markup-Refactor in zitare-web das Hide nicht still bricht:
|
||||
///
|
||||
/// 1. `header[data-app-nav]` — explizit gesetztes Attribut, falls
|
||||
/// zitare-web es irgendwann markieren will (heute nicht da).
|
||||
/// 2. `body header:has(a.brand)` — strukturell: ein `<header>`,
|
||||
/// der einen `a.brand`-Link enthält. Matched die heutige
|
||||
/// SvelteKit-Komponente (Brand „Zitare" links oben).
|
||||
/// 3. `body > * > header:first-of-type` — positionell: erster
|
||||
/// `<header>` direkt unter dem Top-Level-Wrapper. Greift wenn
|
||||
/// `a.brand` mal verschwindet.
|
||||
///
|
||||
/// `body > * > header:first-of-type` ist absichtlich konservativ
|
||||
/// (matcht nur einen `<header>` pro `<body>`-Direktkind), damit
|
||||
/// nicht ungewollt nested Article-Header gehidet werden.
|
||||
static let hideWebHeader: WKUserScript = .init(
|
||||
source: """
|
||||
(function() {
|
||||
var css = 'body header:has(a.brand) { display: none !important; }';
|
||||
var css = [
|
||||
'header[data-app-nav],',
|
||||
'body header:has(a.brand),',
|
||||
'body > header:first-of-type,',
|
||||
'body > div > header:first-of-type {',
|
||||
' display: none !important;',
|
||||
'}'
|
||||
].join('\\n');
|
||||
var style = document.createElement('style');
|
||||
style.setAttribute('data-zitare-native', 'hide-web-header');
|
||||
style.textContent = css;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue