Solution B — Pre-open Window Before async
The key insight: window.open('', '_blank') is called synchronously
inside the button tap handler, before any await. This keeps the call inside
the browser's user-gesture context. Once the PDF is generated asynchronously, we redirect
the already-open window via win.location.href = dataURL instead of opening a
new one — bypassing WebView popup blocking.
Visit Information
Customer
ACME Corp — Branch #42
Purpose
Annual Equipment Inspection
Territory Manager
Jane Smith
Address
100 Industrial Blvd, Toronto ON
Equipment Status
Gun Condition
Needs Service
Safety Equipment
Fire Extinguisher
Present & Valid
Supplied Air Resp.
Present
Immediate Attention
Gun condition is below standard — schedule service within 7 days. Safety manuals must be restocked before next visit.