How to quit Chrome process from within app (on Mac OS X) - google-chrome

I have a custom web app written in Angular that is launched from a bash script. The app provides a GUI for the user to enter some information. Once the user is done, I'd like the bash script to continue execution, however I am unable to kill the chrome process from within the app, I can only close the window (Mac OS X). Is there a way to kill the chrome process when the window is closed? A command line flag or some other workaround?

A solution is using the chrome.windows API, by using the remove() function, which will terminate a window and all its tabs. More information can be found here: https://developer.chrome.com/extensions/windows#method-remove
Another solution, you could try accessing the following url in Chrome, but keep in mind that its only for testing purposes: chrome://kill.

Related

Documentation on Application.launch() in JXA?

Where can I find documentation on Application.launch() in JXA?
Application('Safari').launch();
It seems Application.launch(), unlike Application.activate(), only starts the application process without actually open or activate an application window.
I searched the Internet and find no documentation on this function.
The launch command:
Launches an application, if it is not already running, but does not send it a run command.
If an application is already running, sending it a launch command has no effect. That allows you to open an application without performing its usual startup procedures, such as opening a new window or, in the case of a script application, running its script. For example, you can use the launch command when you don’t want an application to open and close visibly.
via https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW51
Note that while the above documentation is for AppleScript, it mostly applies to JXA, too.

is it possible to keep a packaged app running after `chrome.runtime.reload()` without additional windows?

I have a packaged app that calls chrome.runtime.reload(). On a desktop OS (Windows, OSX) this call will cause the application to close, but not restart unless there is an additional Chrome page open.
I assume this is because if it is the only Chrome app running, it closes the Chrome process entirely and there is nothing to restart it.
Adding the background permission looks like it should work, according to the documentation but it does not seem to actually start Chrome when the user logs in (and keep it running) as the documentation states.
A user can override this globally with a setting.
In Chrome's settings with "Show advanced settings":
System > Continue running background apps when Google Chrome is closed
Perhaps it is disabled on your development system.

Windows Phone 8.1 app starts ok via "normal" start but "hangs" via voice command

I have written a simple Windows phone 8.1 app that starts ok when started via the corresponding application icon.
I also have added a voice command definition file and added voice commands.
My Problem now is that when I speak the corresponding voice command the ...
voice command is recognized successfully
my app is started, i.e. the splash Screen is displayed
BUT the splash Screen is displayed for about 15 seconds and then the app is closed.
Where should I continue to investigate? As mentioned above when the app is started via the application Icon it starts successfully.
So what's the difference when an app is started via a voice command and when it is started normally?
Remarks:
In the code I do NOT react differently, i.e. I do NOT check the way the application is started or try to determine the used voice command ...
When debugging in the Emulator the voice command successfully starts the app.
But when the Debugging instance is stopped, the Emulator Shows the same Problem.
I would post some code but do not know which is the relevant...
In the meantime I have figured out that the problem is fixed by overriding "OnActivated" in App.xaml.cs, which is an alternative entry point to "OnLaunched". OnActivated is used e.g. when the app is started via voice command.

Enable kiosk mode programmatically for windows store apps

We are developing a Windows Store app for a client. The app is designed to run in kiosk mode.
Is there a way to make it easy for the user to enable kiosk mode (Assigned Access) for the app?
Ideally I would like to pop a dialog with an "Accept" button which handles all the necessary configurations.
There is no way to do this programmatically that I know of. However, you can write a Powershell script that will do what you are asking. This Powershell script could then be ran by your client or as part of the initial installation of the app.
http://msdn.microsoft.com/en-us/library/dn449310%28v=winembedded.82%29.aspx

Google chrome allow/deny prompt for using device's webcam with google chrome apps

At the moment google chrome provides me with security for using my device webcam, with a prompt '.. wants to use your camera' allow/deny. each time I load a page i get this option. I'm trying use the camera embedded within my google chrome app
Is there a way to make sure that once user says 'allow' the value is retrieved and user will not have to give access for that particular app.
Is there any API I could use where 'allow' or 'deny click is stored and sent back to the app so that i can do some modifications accordingly.
I cant reproduce that using my chrome browser though. I dont get any prompt for the user to allow/deny.But, client is getting this prompt and are not happy with prompt each time app tries to access camera
If you're talking about Chrome Packaged apps, you can use the "audioCapture" and "videoCapture" permissions in the manifest. No infobar prompt will appear if you include
those.
https://github.com/GoogleChrome/chrome-app-samples/blob/master/camera-capture/manifest.json#L14
If you're writing a normal web app hosted on a web server, than the only way
around the infobar prompt is to run the sight over SSL (https). In that case, users
will only be prompted once. Subsequent uses of your app won't show the prompt if the user
accepts the first time.
One solution is to launch your browser in command line by using the use-fake-ui-for-media-stream property.
start chrome "http://localhost" --use-fake-ui-for-media-stream
More informations about Linux and Mac command line instructions here: https://creativcoders.wordpress.com/2014/08/18/chrome-always-allow-access-to-webcam-and-microphone-over-http-webrtc/