Do Google Chrome desktop applications need to have an appearance? - google-chrome

Is it possible to create a Google Chrome desktop application that runs only as a process in the background which the user cannot directly interact with?
My idea is to create a Chrome browser extension that the user interacts with and that will, via message passing, send data to a Chrome desktop app to operate on before sending it back to the browser extension. I want the operations of the desktop app to be completely invisible to the user.
Is this possible?

Yes, you can simply ignore the onLaunched event, or create a hidden window:
chrome.app.window.create("main.html", { hidden: true })

you can hide the window on app start with chrome.app.window.current().hide()

Related

chrome.desktopCapture throws an error on "tab" as DesktopCaptureSourceType

I am developing a chrome extension, and my point here is to record a browser tab , like Screencastify chrome extension records the browser tab. I referred desktopCapture , a chrome API which works perfectly for "screen" and "window" as DesktopCaptureSourceType, whereas for "tab" as DesktopCaptureSourceType, it throws an error as
desktopCapture.chooseDesktopMedia: Tab capture is not supported yet.
I have configured the required permissions in manifest.json of my extension. Could anyone suggest me a solution?
P.S : I need to record the chrome browser tab only, am not asking for a screen or window recording
This is a known issue: https://crbug.com/488262
However, you can use the chrome.tabCapture api instead. The downside is that you will have to split your interface between capturing tabs and screens/windows, as chrome.tabCapture doesn't provide an equivalent picker.
Why does Google have two separate screen capture apis? Good question.
The stream object generated by the chrome.tabCapture cant be shared outside the plugin code.
You will have to write the code to share the stream to server within the chrome plugin.

Toolbar in Chrome app mode

Trying to employ kiosk based on Chrome browser. Just Installed Kiosk app extension, everything is fine, but in Chrome's application mode there are no toolbar. I basically need "Back", "Forward", "Home" buttons. Is there any way to enable toolbar in app mode, or add it when extension creates window?
Navigation is not meaningful for Chrome Apps. It is, in fact, disabled.
So if your app changes state, you need custom controls for that state anyway.
If you have embedded web content in the app in a <webview>, then you need to make your own custom controls for that. See the browser app sample.

Using chrome to convert window.open to Chrome always on top panel

I have a web app that is using javascript window.open command, my wish is to make these popups always on top.
Looking on the internet I saw recommendation to add body.onBlur='self.focus'.
This is not good for me because other windows cannot be accessed in this kind of approach.
What I thought is to write an extension that on pop-out will convert the window.open-opened pages to a chrome dialog.
The big question: This is even possible?
In the chrome dialog that I have tested the panels are always on to only if they are positioned in the top right of the window but if I am moving them to a different location the always on to function doesn't work
https://chrome.google.com/webstore/detail/site-on-panel/pcjbpfaogjhnnnhdldamflaelejhbhag?utm_source=chrome-app-launcher-info-dialog
https://chrome.google.com/webstore/detail/picture-in-picture-viewer/efaagmolahogmekmnmkigonhfcdiemnl?utm_source=chrome-app-launcher-info-dialog
If you control the web app, you can replace window.open with a Chrome App. You can send a message from the web app to the chrome app, which can then use the always on top app window option and display it in a webview.

How can I get notification of page load events in Chrome?

I need to be able to monitor navigation events (such as page loads or switching between active tabs) in browsers running on a Windows PC. So far, I can get this to work in IE and Firefox by loading a DLL into all running apps via a call to SetWindowsHookEx, then asking for either the IHTMLDocument2 (in IE) or nsIWebProgress (in Firefox) interface from the application. I can use the appropriate interface to request a callback from the application when an event of interest happens.
Is there a way to do this in Chrome? I have read a little about Chrome extensions, but I have not found any documentation on an API exposed by Chrome that is analogous to COM in IE or XPCOM in Firefox. Will a similar approach work or will I need to do something completely different? (I am working in C++.)
I would appreciate it if someone could at least point me in the right direction.
Thanks.
With Chrome extensions API you can register some events handlers for changing state of tab like when document state is changed (loading or loaded), when new tab is added/removed from window or when user switch between tabs.
More about tabs events You find on http://code.google.com/chrome/extensions/tabs.html#event-onActiveChanged

Google Chrome extension installed popup

While installing the Google extensions form chrome web store it shows some popup like "Google Chrome extension is now installed".
I want similarly, while login I need to show the login popup.
Please suggest me on this.
You can create either a browser action or a page action popup. You can change popup html dynamically to make it look completely different depending on the situation but you can't open it programmatically (desktop notifications could be used for alerts).