Make screen capture work in Firefox
Firefox has no tab capture, so preferCurrentTab is silently dropped and the operator can only share a window or a screen. Neither maps onto the viewport the way the crop assumes, so screenshots came out offset by the browser chrome — and every failure was swallowed by a bare catch, leaving no way to tell why. Check the shared surface and only crop when the viewport covers it: exact for Chrome's tab capture, true for a screen while the page is fullscreen. Test that by dimensions rather than document.fullscreenElement, which F11 leaves null. Start now requests fullscreen, after getDisplayMedia so the click's transient activation goes to the fragile call. Reasons surface in a corner notice and the console, and the check reruns per grab so leaving fullscreen says so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H9v2Xoa6eoeGYpK6gp95k9
This commit is contained in:
@@ -318,3 +318,18 @@ body {
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* Bottom left, opposite #status, so the two never overlap. */
|
||||
#notice {
|
||||
position: fixed;
|
||||
bottom: 12px;
|
||||
left: 16px;
|
||||
z-index: 20;
|
||||
max-width: min(46ch, 60vw);
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
background: rgb(0 0 0 / 0.55);
|
||||
color: var(--accent);
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user