Skip to content

[BUG and temporary fix] Open Firefox as the frontmost window (macOS-specific) #914

@zaydek

Description

@zaydek

This is both a bug and a temporary fix for Firefox -- ‘Nightly’ on (macOS 10.14.6 / Playwright 0.10.0) opens in the background which is unexpected behavior.

The expected behavior is that Nightly opens as the frontmost window, just the same as with Chromium and WebKit.

Here’s a temporary fix I’m using that is macOS-specific

import { execSync } from "child_process"

// Bring to front:
execSync("osascript -e 'activate application \"Nightly\"'")
// Open as edge-to-edge (for me, my dimensions are 1440px x 900px
execSync(`osascript -e '
	tell application "System Events" to tell process "Nightly"
		set position of window 1 to {0, 0}
		set size of window 1 to {1440, 900}
	end tell
'`)

Note that this requires adding your terminal to System Preferences:

System Preferences
→ Security & Privacy
→ Privacy
→ Accessibility
→ Allow the apps below to control your computer.

You’ll most likely be prompted to do this anyway.

I hope this helps someone!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions