Capturing Screenshot of Chromium-based Browser (e.g. Chrome) results in Black Screen - screenshot

I'm trying to capture a screenshot of a minimized chromium window with https://www.codeproject.com/Articles/20651/Capturing-Minimized-Window-A-Kid-s-Trick. But all chromium based browsers end up as black and won't show. It works for all other windows like notepad and it works.
But when I try on a chromium based browser I get results like this.
I believe the issue is that it renders differently and i tried disabling gpu and direct x with arguments but it still didn't work.
cmd.exe /c start chrome.exe --no-sandbox --allow-no-sandbox-job --disable-3d-apis --disable-gpu --disable-d3d11 --user-data-dir=
Please do not respond with a method that brings the window to front then minimizes it again, thanks.

Related

Selenium ChromeDriver gives "data;" error for running `webdriver.Chrome` [duplicate]

I tried crawling a specific site using selenium and webdriver_manager.chrome, and my code crawled elements of that site totally. But after crawling, the following error message appears in the console window.
ERROR:gpu_init.cc(426) Passthrough is not supported, GL is disabled
When I first found it, I unchecked Hardware hardware accleration of chrome also it didn't solve the problem.
Tested environment
Windows OS, Chromedriver vesion 89, headless mode
Solution
I am not certain that this can be a solution for your question, since the error message is slightly different.
As I remember correctly, the error message Passthrough is not supported, GL is swiftshader has been shown after the Chromedriver version 89 as a bug (but not certain) [1].
In case of Windows, --headless and --disable-gpu options are required to make the chromedriver work as a headless mode [2]. It seems like --disable-gpu is also required for Linux because of the bug [3].
The error message does not appear if both --headless and --disable-gpu options are removed. However, the chromedriver does not work as a headless mode anymore.
In my case, the error message does not affect the operation of a headless chrome. As I found, "Normally, Chrome would just fall back to work without GPU. However, for consistent results, Telemetry requires the presence of GPU [4]."
I've additionally applied --disable-software-rasterizer option to disable WebGL [5]. The error message does not show anymore under the headless operation.
References
[1] https://reddit.com/r/chrome/comments/n6qywt/hardware_acceleration_fail_in_chrome_on_linux/
[2] https://developers.google.com/web/updates/2017/04/headless-chrome
[3] https://bugs.chromium.org/p/chromium/issues/detail?id=737678
[4] https://groups.google.com/a/chromium.org/g/telemetry/c/bEgV1EH63eA
[5] https://bugs.chromium.org/p/chromium/issues/detail?id=617551
I had the same problem with selenium and chromedriver. For me the solution was to activate WebGL in Chrome browser. I did the following
chrome://settings -> Click Advanced at the bottom -> Check the Use hardware acceleration when available box
chrome://flags -> Search for WebGL in the search bar -> Enable / Activate WebGL
There are much better instructions here: https://superuser.com/questions/836832/how-can-i-enable-webgl-in-my-browser
I got this error as a result of using NVIDIA's Quadro view so for me the fix was to disable that.
I received this error during Eclipse Startup and fixed it by changing two things:
Now using a more recent Java VM for Eclipse, in my case I was moving from Java8 to Java11
Also moving from JRE to JDK
Add Eclipse Start Parameter:
-vm C:\PROGRA~1\ECLIPS~1\jdk-11.0.12.7-hotspot\bin\javaw.exe
This warning was being shown to me in a setup where chromium was running through Xvfb. I managed to get rid of this warning by adding the following flag to the command line:
--disable-features=DefaultPassthroughCommandDecoder
there should be typo mistake in your code , please check ,
i got the similar error in electron
[7608:1220/032708.152:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is disabled, ANGLE is
the problem was type mistake
before
wrong code
// events funstions of electron
SM_app.on('redy', F_create_windows);
fixed code
// events funstions of electron
SM_app.on('ready', F_create_windows);
i was missing a in my code. redy
Check Your Code. Again

Chromium in headless mode is not getting media stream from webcam

I was trying to test if Chromium on Linux is accessing the webcam correctly via the headless mode:
chromium-browser --headless https://example.com --repl
But chrome seemed to be ignoring video capturing device input, since the the webcam indicator LED was not lighting up. However, the same test page worked just fine when Chrome was running in GUI mode.
Here is the output prompt before the REPL line:
[0512/233001.068247:ERROR:gpu_process_transport_factory.cc(1019)] Lost UI shared context.
[0512/233002.458966:ERROR:video_capture_device_factory_linux.cc(102)] Not implemented reached in std::list media::(anonymous namespace)::GetFrameRateList(int, uint32_t, uint32_t, uint32_t)
[0512/233002.459566:INFO:headless_shell.cc(399)] Type a Javascript expression to evaluate or "quit" to exit.
Is this a limitation of the headless mode of Chrome?
Do you really need to use webcam? If not, then you can use fake cam?
If so, then try:
chrome.exe --use-fake-ui-for-media-stream --disable-web-security --use-fake-device-for-media-stream --use-file-for-fake-video-capture="C:\Users\user\Desktop\test\fileName.y4m" --allow-file-access
Using this way you can test webcam in chrome.

Jenkins ver 1.647 generates and displays non-coloured Selenium HTML report

Test suite results in black and white as against the regular green for pass and red for fails
Thats easy to debug. Just run Chrome and view the report while you have the Chrome network traffic debugger enabled. When it fails to download a style sheet, you'll see an error and then you will know the reason why the page doesn't completely render correctly.

How to use/open/enable Dragonfly?

I want to use the Dragonfly debugger for the Opera browser. I'm not sure what I did wrong. I downloaded the opera browser, but when I click inspect element, I just get the firebug debugger. And I'm not just confusing one for the other, because I've used Dragonfly on another machine before. Do I have to download another extension? I'm using a Max OS X 10.7.5. Thanks in advance.
Opera cannot communicate with the native Firebug (from Firefox), so it sounds like you've downloaded Opera, installed the Firebug Lite extension, and are starting this extension (via the button it installs) instead of Opera's built-in Dragonfly (which you start via right-click and "Inspect element", or by using Ctrl+Shift+I or the Mac equivalent). See this answer for more details.

VideoJS on Google Chrome and IE9

I'm trying to run my code in some browsers. It works fine in Firefox and Opera, but in IE9 and Chrome it only works fine the first time.
After, when I want to run this code or another again it shows me the next warning:
"Resource interpreted as Script but transferred with MIME type text/html:"http://www.superfish.com/ws/sf_main.jsp?dlsource=dropdowndeals&userId=RR8BRgZAQDCRcXxJEAgX1g&CTID=1049999"."
However, if I delete the cache of the browser and run the code again, the code run without problems, but only the first time of course.
This problem is only on Google Chrome and IE9.
Do you have any suggestion, please?
Thanks!!
I ran into this on a users machine. It looks like it's AdWare that tries to parse the script tag, but doesn't like it when the type isn't javascript. If you use AdBlock or similar for the browser it should work, but this is just covering up the problem.
The end game would probably be to remove the adware completely.