Hyprland
Hyprland copied to clipboard
Firefox Extensions uninfluenced by `windowrules`
Windows that are opened by Firefox extensions cannot be affected by windowrules.
I have an extension called Tree Style Tabs that opens a window (that should be a modal) to ask for confirmation to discard many tabs.
The output from hyprctl clients when the window in question is open looks like the following:
Window 2734070 -> Extension: (Tree Style Tab) - Close tabs? — Mozilla Firefox:
at: 2888,14
size: 938,1052
workspace: 2 (2)
floating: 0
monitor: 1
class: firefox
title: Extension: (Tree Style Tab) - Close tabs? — Mozilla Firefox
pid: 152850
xwayland: 0
I try to match Extension in the title for all Firefox windows, so that any window opened by an extension will float by default.
windowrule=float,title:^(Extension)(.+)(Firefox)(.*)$
Then the size is set for a more specific pattern, matching if Close tabs is in the middle of the title.
windowrule=size 630 470,title:^(Extension)(.+)(Close tabs)(.+)(Firefox)(.*)$
Neither of these rules work, and neither do less-strict patterns that only look for title:Extension.
I have verified both of these regex patterns, and that windowrules works for other programs.
watch -n 0.1 "cat /tmp/hypr/$(echo $HYPRLAND_INSTANCE_SIGNATURE)/hyprland.log | grep -v "efresh" | grep "rule" | tail -n 40"
will tail the logs for window rules. Whenever a window is open, it will log searching rules, e.g.:
[LOG] Searching for matching rules for org.kde.dolphin (title: Extracting Files (86%) — Dolphin)
Those are the arguments passed to the regex checks. If an app is written by an idiot, it may set its title after mapping, meaning it's basically unmatchable in the current windowrule state.
That does appear to be the issue. This is the window that opens:
[LOG] Set keyboard focus to surface 1ea1300, with window name: Firefox Extensions uninfluenced by `windowrules` Issue #602 hyprwm/Hyprland Mozilla Firefox
This is what it changes to:
Window 1ee3140 -> Extension: (Tree Style Tab) - Close tabs? — Mozilla Firefox:
at: 968,14
size: 938,1052
workspace: 2 (2)
floating: 0
monitor: 1
class: firefox
title: Extension: (Tree Style Tab) - Close tabs? — Mozilla Firefox
pid: 119264
xwayland: 0
Any hope for a remedy? Is it possible to get a signal from somewhere every time a window changes its title?
it's planned.
Since dynamic window rules have been impl'd a while back, I am closing this.
float rules cannot be dynamic though, as it would require an active layout change after the window has already been created.
Hello, is there any solution to this? I have an extension which has a popup that goes fullscreen and I have no way to make floating and/or smaller.
The nofullscreenrequest and nomaximizerequest aren't affecting these popup. Even setting maxsize/minsize/size doesn't affect the window (and I have checked that the rule matches in the log).
I'm having the same problem with Bitwarden popups in Firefox. The following works, but it affects all Firefox windows:
windowrulev2=float,class:^firefox$
windowrulev2=nofullscreenrequest,class:^firefox$
But the following doesn't:
windowrulev2=float,class:^firefox$,title:^Extension:
windowrulev2=nofullscreenrequest,class:^firefox$,title:^Extension:
@musjj missing .*$
@spikespaz Doesn't work either, unfortunately.
That works for me: windowrulev2=nomaximizerequest, class:.*
In my case, I was getting annoying notifications on half screen from "Simple Tab Groups" extension (btw, great extension for managing sessions)