I use this all the time to watch Netflix while programming: put Netflix in PiP mode, then put the resulting window in the corner and switch to other applications to work.
Same, also for YouTube, KimCartoon and many others.
The reason I mention them is because the window ID of the PiP is fixed, meaning that I can easily define a window rule for it in my desktop environment independent from Firefox
Sometimes coding is just mindless typing some boiler plate. It's easy to pay attention to something else. I see it like listening to podcast or something while mindlessly grinding in a game.
The analogy I like is how people listen to the radio while driving. Sometimes you’re just doing something pretty simple (like a tedious refactor) and can move forward while watching something else