How to disable this option in chrome via program - ruby

I am recording the video using screen-recorder in my framework, but to do that I have to disable the option Use hardware acceleration when available but since I clear profile every time when sanity run finishes, this selection also gets deleted along with the profile. Is there any way I can set this option when I am initiating the browser? Like we are disabling the prompt_for_download

you may start chrome with --disable-gpu flag

Related

VLCKit-based app prevents screensaver

I've recently built a simple Swift macOS app based upon VLCKit; its purpose is mainly to play IP camera streams via RTSP in a window that stays always visible on screen (i.e. to monitor a gate).
Given the purpose of the app, I keep the streaming playing all the time, except when the user minimizes it in the Dock (meaning that I only call mediaPlayer?.stop in viewDidDisappear).
The app works very well, but I've recently discovered that, unless it is minimized (and, as a consequence, the playback is already stopped), something prevents the screensaver from running.
I've tried subscribing to all NSNotificationCenter com.apple.screensaver.* notifications, and I've realized that when the playback is running, none of them is fired; if I minimize the app and stop the playback, everything behaves normally (screensaver starts after the regular delay, all the com.apple.screensaver notifications are properly detected).
I've also tried running pmset -g to check if my app was listed as preventing sleep, but it's not.
My impression, but I might be wrong, is that my instance of VLCMediaPlayer by default prevents the screensaver launch.
I know that in the VLC Mac app the screensaver can be manually prevented via an advanced setting, but I can't seem to be able to find a parameter to set in my code to tell VLCKit to stop blocking the screensaver.
To your knowledge, by default VLCKit prevents the screensaver from running? Is there a way to alter that behavior?
Please let me know if you need any further detail... and thanks in advance!
In VLC, there are options called "--disable-screensaver" and "--no-disable-screensaver". By default, "--disable-screensaver" is used.
If you want to enable screensaver just do this:
NSArray *options = #[#"--no-disable-screensaver"];
_mediaPlayer1 = [[VLCMediaPlayer alloc] initWithOptions:options];
What else options available in your VLC lib? pass option "--help" to your VLC and it will list all available options.
What is the full list of options? https://wiki.videolan.org/VLC_command-line_help/
It turned out VLCKit does actually prevent the screensaver from running by default, and that it doesn't use libvlc to do so, so the libvlc option "--no-disable-screensaver" I was at one point trying to pass was not respected.
The solution was to comment out a UpdateSystemActivity() function call on line 1409 of VLCMediaPlayer.m, as suggested to me here.

Firefox Dev tools: How to persist calls in network analysis

Since Firebug is outdated with a recent update of Firefox I'm trying to work with the Firefox dev tools. As far as I read these are supposed to replace Firebug.
However there is one option I used frequently in Firebug and haven't found yet in the Dev tools: The persist option in the network analysis.
Since I work on a project that uses AJAX Calls to send data and then redirect to another page, I need to persist the calls to analyze them after the redirect. Otherwise the time is far to short to have a look at the data that was send with this call. (This project is for work so this architecture is nothing I could change).
Is there a way to persist the network calls in the Firefox Dev tools?
(I use Firefox 56.0.1 by the way)
Open the Settings for the Developer Tools:
Then select "Enable persistent logs" under "Common Preferences."
Reference: https://developer.mozilla.org/en-US/docs/Tools/Settings
Starting from Firefox 57.0 the option got moved from the Settings to the Network panel:
On Firefox for Mac, in version 101.0.1, the "Persist Logs" option is now hidden behind the gear icon in the top right of dev tools box.

Why Selenium starts Firefox in safe mode sometimes (without user pressing Shift)?

I am using Firefox Selenium Web Driver to run automatic tests on a dedicated testing machine, so there is nobody pressing Shift there that would cause Firefox to start in the safe mode. But still several times a day Firefox starts with this safe mode dialog:
Any idea what could be causing this behavior?
Multiple tests are running at the same time, so there are several Firefox instances, can they maybe influence each other somehow?
I have disabled automatic safe mode after Firefox crashes as described here, but without success.
The reason is that some of my tests are running external AutoIt script that is "pressing" a Shift key to enter upper case letters. If another test is starting its Firefox at the same moment, Firefox detects the Shift key and displays the Safe Mode dialog.
osdHotkey simple utility that displays and logs pressed keys helped me to find out what is going on.

Open Chrome from terminal with developer console open

I can run Google Chrome from the command line using $ google-chrome, but what flag can I pass to open it with developer console already open, preferably open to the console tab?
I checked the man page for google-chrome but it states that
Google Chrome has hundreds of undocumented command-line flags that are added and removed at the whim of the developers.
I'm hoping one of those undocumented flags does what I want.
The flag you're looking for is --auto-open-devtools-for-tabs. Please note, that you should quit Chrome before this setting will take effect.
This has worked at least since Chrome 55.0.2883.87 m (the latest version as of initial post)
A Google employee maintains this list of automatically updated Chromium flags. There doesn't seem to be a flag for opening Chrome with developer console open.
Seems there is no such option. I added a feature request in Chrome product forum
https://productforums.google.com/forum/#!category-topic/chrome/give-feature-feedback-and-suggestions/mac/Stable/3HYIAl8_ndc
What exactly are you trying to achieve by that? If you are trying to run some kind of automated tests, you should try out PhantomJS.

Simulate Offline Mode for HTML5 Cache Testing

I have an HTML5 application that requires offline support. For running the application, I use a local Apache server. I am trying to figure out what the best way is to simulate offline mode.
Currently, in Firefox I disable my Air-Port to simulate offline mode, but this is a pain.
Any suggestions? I am open to using other browsers, if a method exists that doesn't require turning off my Internet.
For Firefox
☰ (hamburger menu)->More->Work Offline
Google Chrome doesn't appear to have this feature
Edit:
Also, another alternative is slightly more time-consuming to setup in the beginning but might be worth it. For Firefox/Chrome there should be proxy plugins, set up a fake/bad profile for each so that you proxy to something that doesn't exist... like 127.0.0.20:8080. After that you can switch the proxy setting on and off to emulate a full-stack test.
The other answers are out of date. The only place this appears in Firefox v92 is under
File > Work Offline
The File menu can be accessed in the top left of Firefox by pressing the ALT key.
Be warned that this does not prevent traffic from "localhost" loop-back itself, unless you additionally turn on
network.disable-localhost-when-offline
preference in about:config.
Bugzilla issue: Add option to disallow connections to localhost while in offline mode.
In Chrome you can open developer tools switch to the network tab and set throttling to offline
For Firefox, from the ☰ (hamburger menu), choose Web Developer > Work Offline.
For Chrome, open DevTools and select the Network panel. Throttling is set to Online (Disabled) by default. From the dropdown menu, you can choose presets Fast 3G and Slow 3G, but to simulate Offline Mode, you want to choose Offline.

Resources