vscode-edge-devtools icon indicating copy to clipboard operation
vscode-edge-devtools copied to clipboard

"The Tab is inactive" message appears when the browser is minimized, the selected tab is changed, or VS Code is full screen

Open thevarunraja opened this issue 7 years ago • 19 comments

IDK whether I am using this tool correctly or not. I am seeing the below

Screen Shot 2019-07-15 at 12 34 05 PM

thevarunraja avatar Jul 15 '19 16:07 thevarunraja

Thanks for filing the issue.

This is a limitation of the screencasting API that we are using. Right now you need to have the Edge tab that you are connected to, selected as the current tab in the browser. You also need to have the browser itself not minimized.

I'll update the title to reflect this, but keep it open in case we can find a better solution at some point.

jalissia avatar Jul 15 '19 16:07 jalissia

@jalissia Thanks for the explanation. This happens for me when I use VSCode in Zen Mode. It works like a charm in Normal mode.

thevarunraja avatar Jul 15 '19 16:07 thevarunraja

Interesting, I don't think I've ever tried Zen Mode (so many neat VS Code features, so little time). Are you on Windows or Mac? If I enter zen mode after attaching the elements tool (without moving the browser/tab at all) it seems to stay active for me (on Windows 10).

Certainly something for us to look into though as I know the API has limitations.

jalissia avatar Jul 15 '19 17:07 jalissia

I am on Mac.

thevarunraja avatar Jul 15 '19 17:07 thevarunraja

I can repro @thevarunraja findings. Zen mode (simplified explanation) puts vscode in fullscreen mode. In the latest mac osx versions full screen creates a "new desktop" which remove focus from the other window(s). To test this I moved vs code to "virtual dekstop 1" (without zen mode) and Edge browser to a "virtual desktop 2" and could observe the same behavior. In short:

Repro steps (1):

  • Open VScode with vscode-edge-devtools extension (on mac)
  • Open a new window and attach to it using vscode-edge-devtools extension
  • Tun Zen mode on (Ctrl-K + Z)

Repro Steps (2):

  • Open VScode with vscode-edge-devtools extension (on mac)
  • Open a new window and attach to it using vscode-edge-devtools extension
  • Move vscode to a different virtual desktop

Expected: Screencast should work

Observed: tab is inactive appears on screen cast

Note: On Windows 10 Repro steps 2 work as expected.

vidorteg avatar Jul 15 '19 20:07 vidorteg

MAC user here.

"The Tab is inactive" message appears when VSCode completely covers the Edge window or when they are on different screens.

The message disappear when :

  • VSCode and Edge are not in full screen mode
  • VSCode and Edge are on the same virtual screen
  • VSCode's window is smaller than the Edge's one

Borongaj avatar Jul 20 '19 18:07 Borongaj

I encountered this while using a Windows computer with the Edge window minified. Maximizing it made it work normally. image

erdraud avatar Aug 02 '19 21:08 erdraud

Verified on Mac. It is enough to have the browser window one pixel bigger than the vs code one, but this is annoying. This could be a battery saving thing on Mac.

codepo8 avatar Oct 14 '19 12:10 codepo8

having the same issue on windows, found out that the only way to change the screen is to use alt+tab or other method rather than minimize.

mhamri avatar Apr 01 '20 18:04 mhamri

This could be fixed by using the headless version, let's verify that.

codepo8 avatar Aug 11 '20 13:08 codepo8

Verified that this issue does not repro in the headless version.

mliao95 avatar Sep 01 '20 19:09 mliao95

This is fixed.

codepo8 avatar Nov 09 '20 21:11 codepo8

This still happens for me on Windows. Latest Windows Update, latest VS Code, latest Edge.

Strangely, it happens even if I just ALT+Tab away from the window into VS Code.

ffMathy avatar Jun 12 '21 09:06 ffMathy

This is still observed with the latest version of chrome on Windows & Mac OS. Can anyone share the resolution for mitigating this? Thanks in advance.

Note: Usecase at my end is launch the browser in debug mode and interacting with it using the dev tools capability [Selenium WebDriver + debuggerAddress].

sagarpabba avatar Jul 22 '21 03:07 sagarpabba

Locate Chrome on your computer Windows Button =>Chrome Right Click and Open in Windows Explorer Right clock on the file Properties Compatibility Settings Run this program as an administrator

Now, in Visual Studio (probably similar in VS Code), add another browser to the VS Browser list (via Browse with)

  • Program: C:\Program Files\Google\Chrome\Application\chrome.exe
  • Arguments: --remote-debugging-port=9222 --user-data-dir="%LOCALAPPDATA%\Temp\blazor-chrome-debug"
  • Friendly Name: Chrome debugging

Set as default Run the application

In both the browser window and the developer window, it will appear as if the application is inactive (the tab is inactive) But. In the browser window, try to click on the menu items ! (set some breakpoints in the developer windows under Sources=>File... first). And voila !

GuttormAndreas avatar Aug 05 '22 14:08 GuttormAndreas

When chrome launched new headless mode (with --headless=new), this problem appears. This problem solved by launch chrome with --headless=old. For example in puppeteer.js, launch with option headless: true. Hope this help.

khaschuluu avatar Jul 28 '23 08:07 khaschuluu

Confirmed we do not see this on --headless (legacy) but only on --headless=new. I'm going to look for some browser flags to fix this, or a way to use DevTools protocol.

For a live demo of this happening on a real headless (new) browser, check out:

https://puter.com/app/cloudtabs-browserbox

edit

Could not find a workaround in Chrome flags. But I'm going to try this protocol message:

{
                    "name": "setFocusEmulationEnabled",
                    "description": "Enables or disables simulating a focused and active page.",
                    "experimental": true,
                    "parameters": [
                        {
                            "name": "enabled",
                            "description": "Whether to enable to disable focus emulation.",
                            "type": "boolean"
                        }
                    ]
                },

Confirmed Fixed by using Emulation.setFocusEmulationEnabled

Hey @jalissia , @codepo8 , @khaschuluu, @ffMathy, @sagarpabba , @mhamri I confirm this is fixed when using this protocol message sent to the target you want to inspect.

See permalink for example code.

See a quick demo of "This Tab is Inactive" fixed by Emulation protocol message running in development CloudTabs / BrowserBox

https://youtu.be/fhXvoQhbjls

or screen recording hosted on GitHub

https://github.com/microsoft/vscode-edge-devtools/assets/22254235/9567e33f-e645-46f3-9726-3548137fe3a4

Protocols ref

crisdosaygo avatar Apr 12 '24 02:04 crisdosaygo

I'm having this issue too, pretty much everytime I try and use this with a nextjs project. It's super annoying! All i have to do is open up the connected devtools, open the browser view from that, and then after a little messing around I get the "tab is inactive" overlay and there doesn't seem to be anyway to make it active ever again. Super annoying. On Mac with latest vs code & extension version.

mistcat avatar Sep 15 '24 20:09 mistcat

@mistcat I have the same issue on Mac, whenever I press shift focusing on the browser view inside vscode this message appears and we are done here

Dozorengel avatar Apr 08 '25 12:04 Dozorengel