Skip to content

Commit 732927b

Browse files
Make sure that special treatment for Firefox windows works for all Firefox editions
_closes #1108 closes #1130 - Works for Firefox, Firefox Developer Edition, and Firefox Nightly version Co-authored-by: fullmetalsheep <23723926+fullmetalsheep@users.noreply.github.com>
1 parent ce6628e commit 732927b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Sources/AppBundle/tree/AbstractApp.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ class AbstractApp: Hashable {
3232

3333
extension AbstractApp {
3434
func asMacApp() -> MacApp { self as! MacApp }
35+
36+
func isFirefox() -> Bool {
37+
["org.mozilla.firefox", "org.mozilla.firefoxdeveloperedition", "org.mozilla.nightly"].contains(id ?? "")
38+
}
3539
}
3640

3741
extension Window {

Sources/AppBundle/tree/MacWindow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func isWindow(_ axWindow: AXUIElement, _ app: MacApp) -> Bool {
261261
return false
262262
}
263263

264-
if app.id == "org.mozilla.firefox" {
264+
if app.isFirefox() {
265265
return isWindowNew(axWindow, app)
266266
}
267267

@@ -310,7 +310,7 @@ func isDialogHeuristic(_ axWindow: AXUIElement, _ app: MacApp) -> Bool {
310310
}
311311
// Firefox: Picture in Picture window doesn't have minimize button.
312312
// todo. bug: when firefox shows non-native fullscreen, minimize button disables for all other windows
313-
if app.id == "org.mozilla.firefox" && axWindow.get(Ax.minimizeButtonAttr)?.get(Ax.enabledAttr) != true {
313+
if app.isFirefox() && axWindow.get(Ax.minimizeButtonAttr)?.get(Ax.enabledAttr) != true {
314314
return true
315315
}
316316
if app.id == "com.apple.PhotoBooth" { return true }

0 commit comments

Comments
 (0)