Firefox Auto PiP: Turn On Picture-in-Picture When Switching Tabs

Martin Brinkmann
Updated •
Firefox

Firefox Auto PiP opens a playing video in a floating Picture-in-Picture window automatically when you switch to another tab, and closes the window when you return. Turn it on in Settings > Firefox Labs by checking "Picture-in-Picture: auto-open on tab switch", or set media.videocontrols.picture-in-picture.enable-when-switching-tabs.enabled to true in about:config. No restart is needed.

This guide covers how to enable and disable Auto PiP, how it behaves on video sites, the regular Firefox Picture-in-Picture settings and shortcuts, and what to do when the floating window keeps appearing after you turned it off.

What is Firefox Auto PiP?

Firefox Auto PiP is an experimental Firefox Labs option that detaches the video you are watching into a floating, always-on-top window the moment you leave its tab. It builds on the Picture-in-Picture mode that Mozilla first started building into Firefox in 2019, which normally needs a click on the PiP toggle or a keyboard shortcut.

With Auto PiP, the activation and deactivation steps disappear. Start a video, switch to another tab to read, write or search, and the video keeps playing in the corner of the screen. Switch back to the video tab and the floating window closes, while playback continues in the page without interruption.

Mozilla began testing the option in Firefox Nightly in August 2024 as part of a wider set of Firefox video playback improvements. It later appeared in Firefox Labs in the release version of the browser. Labs features are still in development, so Mozilla may change, rename or remove the option in future versions.

How to enable Auto PiP in Firefox

Firefox Auto PiP is off by default and is enabled with one checkbox in Firefox Labs:

Firefox Labs settings with the Picture-in-Picture auto-open on tab switch option
The Picture-in-Picture: auto-open on tab switch option in Firefox Labs
  1. Update Firefox first: open Menu > Help > About Firefox and install any pending update.
  2. Open Menu > Settings and select Firefox Labs in the sidebar. You can also load about:preferences#experimental in the address bar.
  3. Check "Picture-in-Picture: auto-open on tab switch".
  4. Play a video on YouTube or another site that supports Picture-in-Picture, then switch to another tab to test it.

The change applies immediately. If you prefer the advanced configuration page, or Firefox Labs does not show the option, the same switch is available in about:config:

  1. Type about:config in the address bar and accept the warning.
  2. Search for media.videocontrols.picture-in-picture.enable-when-switching-tabs.enabled.
  3. Double-click the preference to set it to true (on) or false (off).

A YouTube video opening automatically in a Firefox Picture-in-Picture window after a tab switch

How Auto PiP behaves on video sites

Firefox Auto PiP triggers only for a video that is actively playing on a site that supports Firefox Picture-in-Picture. Paused videos stay in their tab. Reports from testers show it working on YouTube, Vimeo and self-hosted Jellyfin servers, while some short-form players, such as Instagram reels, pause instead of floating.

A few behaviors are worth knowing before you rely on it:

  • The floating window can open in a default position rather than where you last placed it, so it may cover part of the new tab. Drag it to a screen corner.
  • Returning to the video tab closes the PiP window and playback continues in the page.
  • Closing the tab you switched to does not send the video back; it keeps floating until you return to its tab or close the window.
  • All regular Picture-in-Picture controls and shortcuts work in the automatic window.

Firefox Picture-in-Picture window floating over another browser tab

Firefox Picture-in-Picture settings and shortcuts

Firefox Picture-in-Picture (PiP) works without Auto PiP too: hover over a video and click the PiP toggle, or right-click the video and pick Picture-in-Picture. On YouTube, which replaces the context menu, hold Shift while right-clicking to get the Firefox menu. Mozilla's Picture-in-Picture help page lists these controls:

Action Windows and Linux Mac
Open PiP for the most relevant video Ctrl+Shift+] Command+Shift+Option+]
Pause or resume Space Space
Seek 5 seconds Left or Right arrow Left or Right arrow
Volume up or down Up or Down arrow Up or Down arrow
Toggle fullscreen F or double-click F or double-click
Close the PiP window Ctrl+W Command+W

The PiP toggle appears on videos longer than 45 seconds that have an audio track. Right-click it and choose Hide Picture-in-Picture Toggle to remove it. To hide it on every site, open Settings > General > Browsing and uncheck "Enable picture-in-picture video controls". Captions you turn on in the site's player, for example on YouTube or Netflix, also show in the PiP window.

Is the Firefox PiP window always on top?

Yes, the Firefox Picture-in-Picture window floats always on top of other windows by design, so the video stays visible while you work in Firefox or in other programs. You can move and resize it freely, and you can open several PiP windows at once, one per video.

Firefox has no setting in its Settings pages to turn off the always-on-top behavior. If the window gets in the way, shrink it, drag it to a screen edge or close it with its close button (Ctrl+W, or Command+W on a Mac), and the video stays in its original tab. If videos stutter in the PiP window, check hardware acceleration in Firefox and the Firefox YouTube performance tweaks.

Auto PiP keeps opening after you turned it off

If Firefox keeps opening a floating video on every tab switch after you unchecked the Labs option, the about:config preference is usually still set to true. Several Firefox users reported exactly this on Mozilla's support forum, and setting the preference to false resolved it:

  1. Open about:config and accept the warning.
  2. Search for media.videocontrols.picture-in-picture.enable-when-switching-tabs.enabled.
  3. If the value shows true, double-click it so it changes to false.
  4. Switch tabs with a video playing to confirm the window no longer opens.

Unchecking "Enable picture-in-picture video controls" in the General settings only hides the toggle button; it does not stop Auto PiP. Use the Labs checkbox or the preference above to switch the automatic mode off.

FAQ

Do subtitles work in the automatic PiP window?

Yes, captions you enable in the site's own player, for example on YouTube, Netflix or Prime Video, also appear in the Picture-in-Picture window. Turn them on before you switch tabs.

Does Auto PiP need an extension?

No, Auto PiP is built into Firefox and needs no add-on. Third-party extensions with similar functions exist, but the Labs option or the about:config preference is enough.

Can I keep Picture-in-Picture but stop the automatic mode?

Yes, uncheck "Picture-in-Picture: auto-open on tab switch" in Firefox Labs. The manual PiP toggle, context menu entry and keyboard shortcut keep working.

Related: How to enable tab groups in Firefox, Fix video background play in Firefox for Android

Comments

  1. Mark said on
    Reply

    The only thing I want from picture-in-picture is to turn it off – completely.

    I watch videos in FULLSCREEN. I do not want a video followijng me accross tabs like a fly.

    Fine for those that want it, but, please let those of us that don’t be able to disable it.

  2. Pierre said on
    Reply

    The pb is : this mode is impossible tu desactivate entirely

    1. Tom Hawack said on
      Reply

      @Pierre, I’m running Firefox 115.14.0 ESR so I’m not sure that the prefs I’ve set for this version of Firefox will handle the PiP feature as well on latest Firefox versions.

      These are my about:config modified prefs :

      // DISABLE PICTURE-IN-PICTURE MODE
      pref(“media.videocontrols.keyboard-tab-to-all-controls”, false); // DEFAULT=true
      pref(“media.videocontrols.picture-in-picture.allow-multiple”, false); // DEFAULT=true
      pref(“media.videocontrols.picture-in-picture.audio-toggle.enabled”, false); // DEFAULT=false
      pref(“media.videocontrols.picture-in-picture.display-text-tracks.enabled”, false); // DEFAULT=false
      pref(“media.videocontrols.picture-in-picture.enabled”, false); // DEFAULT=true
      pref(“media.videocontrols.picture-in-picture.keyboard-controls.enabled”, false); // DEFAULT=true
      pref(“media.videocontrols.picture-in-picture.video-toggle.always-show”, false); // DEFAULT=false
      pref(“media.videocontrols.picture-in-picture.video-toggle.enabled”, false); // DEFAULT=true

      Maybe that’ll help, should it be but partially on recent versions of Firefox.

  3. Henk said on
    Reply

    I happen to be very bad at multitasking, and this weird concentration handicap probably explains why I don’t understand the point of PiP at all. Or maybe it is because of my lack of imagination. Anyway, I just cannot think of any real-life situation where I would want (and be able) to do two different things on the same screen simultanuously.

  4. SoonToBeLinuxDailyDriverUser said on
    Reply

    Tried it, loved it. That’s a keeper feature for me.

    Thanks for the article.

  5. Tachy said on
    Reply

    “Automatic” PiP is like that fly in the summer that just won’t leave you alone.

    I like the function but not on automatic. That’s for advertisers, not the user.

  6. Mutant77 said on
    Reply

    I never used it, but saw already the button in Firefox. After reading the article I tried it. cool Feature.

  7. Marcie G. said on
    Reply

    You “dislike the concept”? Right, as if FF really cares what you think. Or do I.

    “Whether we like it or not”? Huh? Don’t assume or pretend to speak for others.

    1. bruh said on
      Reply

      “Whether we like it or not” literally doesn’t make assumptions – your grasp of the english language is atrocious.

      Why are you crying about a small personal touch to an article? There’s plenty of AI generated slop you can read instead, if you don’t like people?

  8. John G. said on
    Reply

    It’s always good to save time, mainly to see more amazing Youtube videos with one hundred cats.
    Thanks for the article! :]

  9. Tom Hawack said on
    Reply

    Definitely not a user of Picture-in-Picture mode for a very simple reason : I dislike the very concept.
    Having a video running while occupied with something else, with another site, within the site itself, within the article’s video itself does not fit in my relationship to information. A musical background is another thing and, still, must remain “neutral” so to say, i.e. instrumental music, something I appreciate when surfing the Web.

    Now, I’m aware that some of us have more “brain multitasking” capacities than others. I remember my dad reading the papers while viewing a movie on TV and whispering “he’s the murderer” yet not even pausing his lecture of the newspaper … well, looks like that ability to conduct two activities requiring a minimum of attention wasn’t included in the genetic transfer :)

    What I mean is this : PiP, whether we like it or not, is maybe tightly related to one’s capacities to perform two activities simultaneously. Of course we can wonder if these two (or more !) activities are as well conducted as they’d be with a full concentration for each as when the only object of our attention : that’s the question (I struggle to avoid becoming a certitude!) when I notice my aversion for PiP :)

    1. Marcie G. said on
      Reply

      You “dislike the concept”? Right, as if FF really cares what you think. Or do I.

      “Whether we like it or not”? Huh? Don’t assume or pretend to speak for others.

      1. Tom Hawack said on
        Reply

        Stating “whether we like it or not” is speaking for all and no one given all either like it, or not :).
        Stating that I dislike the concept was the explanation of my response to the article’s question, which I further developed to expressively consider that my preference was tied more to a personal nature than to a rational argument : seems to me this is intellectually honest and all the opposite of speaking for others!

        Meanwhile you haven’t had your word for the article. Your concern for little old me is most generous but remember, the star here is neither you nor me, bur the article.

        Dear Marcie (I love that name) …

    2. Anonymous said on
      Reply

      Depends on the task. I can completely concentrate on the video in PiP while playing chess or backgammon, but obviously I can’t do the same if I’m reading a Wikipedia article.

Leave a Reply

By commenting, you accept our privacy policy and keep the discussion respectful and on topic.