MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / toggleFullscreen

Method toggleFullscreen

web/observatory/js/hud-controller.js:529–555  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

527 if (!overlay) return;
528 this._settingsOpen = !this._settingsOpen;
529 overlay.style.display = this._settingsOpen ? 'flex' : 'none';
530 }
531
532 toggleFullscreen() {
533 // When embedded in the dashboard the observatory lives inside a boxed
534 // iframe, so it cannot escape its container on its own. Ask the parent
535 // page to expand the iframe to fill the viewport (and go OS-fullscreen).
536 if (window.parent && window.parent !== window) {
537 try {
538 window.parent.postMessage({ type: 'observatory-fullscreen' }, '*');
539 return;
540 } catch (err) {
541 console.warn('[observatory] could not message parent for fullscreen:', err);
542 }
543 }
544 // Standalone (opened directly): use the Fullscreen API on this document.
545 const fsEl = document.fullscreenElement || document.webkitFullscreenElement;
546 if (!fsEl) {
547 const el = document.documentElement;
548 const req = el.requestFullscreen || el.webkitRequestFullscreen;
549 if (req) {
550 Promise.resolve(req.call(el)).catch(err => {
551 console.warn('[observatory] fullscreen request failed:', err);
552 });
553 }
554 } else {
555 const exit = document.exitFullscreen || document.webkitExitFullscreen;
556 if (exit) Promise.resolve(exit.call(document)).catch(() => {});
557 }
558 }

Callers 1

initSettingsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected