fullscreen browser

This commit is contained in:
Chris Wanstrath 2025-10-02 22:12:04 -07:00
parent 0f49cbeabd
commit e7b4d47456
2 changed files with 12 additions and 5 deletions

View File

@ -10,8 +10,10 @@ iframe.browser {
margin-top: var(--browser-bar-height);
}
iframe.browser.fullscren {
iframe.browser.fullscreen {
margin-top: 0;
width: 100%;
height: 100%;
}
[data-mode="tall"] iframe.browser {

View File

@ -75,13 +75,17 @@ function handleAppMessage(event: MessageEvent) {
}
function closeBrowser() {
iframe.remove()
controls.style.display = "none"
window.removeEventListener("keydown", handleBrowserKeydown)
window.removeEventListener("message", handleAppMessage)
controls.removeEventListener("click", handleClick)
iframe.removeEventListener("load", handlePageLoad)
iframe.src = 'about:blank'
setTimeout(() => {
iframe.remove()
controls.style.display = "none"
focusInput()
}, 0)
}
function handleBrowserKeydown(e: KeyboardEvent) {
@ -140,7 +144,8 @@ function stopLoading() {
function fullscreenBrowser() {
controls.style.display = 'none'
iframe.classList.add('fullscren')
iframe.classList.add('fullscreen')
document.body.append(iframe)
}
function sendNavCommand(action: 'back' | 'forward' | 'reload' | 'stop') {