Suppress screen share permission dialog in Chrome App - google-chrome

We are implementing a Chrome App that runs in a controlled environment on a specific machine under Windows. We have complete control over the environment, including using command-line args to run Chrome, changing registry settings, etc.
Part of the functionality of the app is to take screen captures and stream them to a remote machine. When this feature is initiated, Chrome displays the permission dialog ("Chrome wants to share your screen...") and requires validation by the user.
In the context of our app, this is poor user experience and we would like to find a way to suppress this dialog. As I mentioned, we have complete control over the host machine. Is there any way to do this short of making our own custom Chrome build?

Try running Chrome with the command line argument --auto-select-desktop-capture-source="Entire screen". Source: Chromium issue. Also related: Issue about force-installed extensions and desktop sharing.
In case you want to compile chrome yourself, this would be a good starting point for whitelisting your own extension

For C# Selenium Users. Do not put the "Entire screen" in double quotes.
use it as --auto-select-desktop-capture-source=Entire screen //<--observe no double quotes
var chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("--auto-select-desktop-capture-source=Entire screen");
var driver = new ChromeDriver(chromeOptions);

Related

Change security settings in Chrome to allow unrestricted Bluetooth access

I am developing an app that makes use of Chrome's Bluetooth API. The development is highly annoying because everytime I change my code, the page reloads and I need to request permissions to connect to the Bluetooth device again and those permissions can only be granted through a manual process of clicking through an interface
const device = await navigator.bluetooth.requestDevice(options);
will trigger this (sorry the screenshot is german)
It is not possible to save and restore the permissions for Bluetooth
navigator.permissions.query({name:'bluetooth'})
this is intended to be possible someday but it's a work in progress in the chromium project.
Now I wonder, is it in any way possible to change settings in chrome to loosen a security setting to allow me to just access bluetooth without having be be granted access? Not via JavaScript but by maybe through some setting in Chrome or some sudo command I can execute?
Apologies for the very late response to this question.
I recently implemented a new permissions backend as well as two APIs that will enable previously permitted Bluetooth devices to be used.
The new permissions backend is implemented behind the chrome://flags/#enable-web-bluetooth-new-permissions-backend. The new backend will persist device permissions granted through requestDevice() until the permission is reset in Site Settings or the Page Info dialog box.
The getDevices() and watchAdvertisements() are implemented behind the chrome://flags/#enable-experimental-web-platform-features flag for Chrome 85.0.4165.0 or greater. The recommended use of these APIs is to use getDevices() to retrieve an array of permitted BluetoothDevices and then calling watchAdvertisements() on these devices to start a scan. When advertisement packets are detected from the devices, the advertisementreceived Event will be fired on the device that it corresponds to. At this point, the Bluetooth device is in range and can be connected to.
Please give this new feature a try, and file any bugs at https://crbug.com using the Blink>Bluetooth component.

Facing issue while trying to run Robot framework script in google chrome browser

I am facing a Chrome popup while trying to run Robot Frame work script:
Microsoft Security Essentials wants to restore your Chrome settings to their
original defaults.
This will reset your homepage, new tab page and
search engine, disable your extensions, and unpin all tabs. It will
also clear other temporary and cached data, such as cookies, content
and site data.
In chrome extension, my developer mode is unchecked, whereas it should be checked.
The Robot Framework automation script is just to open the google Chrome browser and load google search page.
I am using Win 7 Home Basic OS.
I have attached screenshots.
It appears that most Chrome support specialists will ask you to run an anti-malware tool to verify that your system is running normally. These can be found by searching on the popup message.
One Reddit user commented that in his case the problem was resolved by altering the Windows registry:
I finally found a fix for this. There is a setting in the registry
that's causing it.
In the registry it's under
HKEY_CKU\CURRENT_USER\Software\Google\Chrome\TriggeredReset
Delete the TriggeredReset key and then close regedit. Fixed.
This is an API for 3rd party programmers who want to create cleaning
tools. But if the tool isn't written properly, the triggered reset
never gets deleted and we have it always asking.

"Chrome legacy Window" when launching chrome with RunAs

I am trying to use MSAA (on Win7) to get the addressbar in chrome browser and replace it with a different url. When chrome is launched normally (as the loggedon user), I am able to find the addressbar using the IAccessible interface by traversing through the UI tree of the window classes owned by the process.
However, if I launch chrome as a different user (by using RunAs in windows), I see window with name, "chrome legacy window" when going through the classes owned by the "RunAs" process. The window hierarchy and the content within is vastly different from what I see if I scan the process that is running as the logged on user.
Although I can see (window classnames) Chrome_WidgetWin_0 & Chrome_WidgetWin_1 in both the browser instances, only the one running as the current user is giving access to the address bar.
Any idea on what is happening when chrome is launched as a different user? Is there any workaround or should I be looking at a different technology?
As Penn has noted this may have something to do with the PDF view which has caused peculiar problems in the strangest of places.
Looking at the bug tracker here it looks like sporadic behaviour with PDFs and the "legacy window" has been introduced in a recent build so perhaps try rolling back to an earlier version of Chrome.
Also I presume you are using chrome://accessibility with
Global accessibility mode: on
Show internal accessibility tree instead of native: on
or starting chrome with the flag --force-renderer-accessibility it seems to be a prerequisite for other automation programs like autoit as seen here.
If you can't get this method working I'd recommend trying the autoit script there.
Here is an autoit code example that shows grabbing the address bar and using it for general navigation, upon other things!
I have found that if a PDF file is open in the chrome viewer (in some versions of chrome) the window you referred to appears. Please confirm what URL is being used when you open chrome.
I have also read that a password request prompt can cause the same window to open. The PDF window only appears if the window is launched by certain processes/users

Can you still create a Chrome packaged app in the browser with manifest 2.0?

All of the examples I've seen show apps launching in their own windows. This may be great an all for chromebook/chrome os, but is there still an option to launch in a browser tab?
No, there is no way to do that. Chrome Packaged Apps are not supposed to run inside a browser. You can, however, open URLs in a browser tab using window.open. But you won't have control of that tab after you issue the command.
If you need some sort of integration/control between your Chrome Packaged App and the browser, you can create an extension and make a communication pipe between the extension and the app - as long as both are running, using the chrome.runtime.sendMessage API.
See this sample for a simple code that does exactly that (two apps and one extension exchanging messages directly, without any server component).
chrome.app.window.create will create a new Window for an App.
If you want window manipulation, you should switch to chrome.tabs API and look for an extension instead of an App.
Reference
chrome.tabs
chrome.app.window

Google Chrome Application Mode: Possible to isolate multiple instances?

I want to run multiple Google Chrome application windows logged into the same web site (Twitter.com, say), each with different credentials. Is this possible? If so, how?
My initial testing shows that multiple Chrome app windows are not sufficiently isolated to do this. Logging into the second account logs me into the second account in both windows, suggesting that they are sharing information just as two Chrome tabs might.
You can use a Chrome "Incognito" window for this.
As you've found, Chrome windows are (like in most browsers) just groupings for tabs, not an authentication barrier.
look for a plugin called "swap my cookies"
You can't do that with chrome Incognito windows.
Take a look here: http://code.google.com/p/chromium/issues/detail?id=24690.
So that's right you can create only two isolated session: one incognito and one normal.
See the latest post:
Although it's an extension / plug-in and not in core Chromium, MultiLogin has been working quite well for me: https://chrome.google.com/webstore/detail/nccllfnllopfpcbjdgjdlfmomnfgnnbk
It can open new tabs, each with their own cookie jar.