Chrome WebRTC Screen Sharing: On stopping screen share, browser window doesn't become active/focused automatically - google-chrome-extension

This is regarding Screen Share on Chrome browser using WebRTC.
An example implementaion of Screen Share on Chrome using WebRTC is: https://talky.io
When the user choses to share a different application(say a text editor), that app's window becomes active(focused) and comes on top of browser, and this is as expected...
The Problem
But after sharing this application, when user clicks on the "Stop sharing" button(present on the floating widget provided by Chrome), the previously shared application window remains on top(focussed). Ideally on stopping screen share, the browser window should be brought back on top, as in focussed.
Is there a way to achieve this using Javascript focus method? Or is this something that Chrome should take care of.

Related

How Mirror webpages as Web Video Wall into another browser?

We have a video wall with some monitors. each one is plugged into a Raspberry PI 3.
Mostly we just are showing webpages into the video wall (reports, status etc)
Today we control the content of each raspberry using VNC. I was wondering if is there a web service or plugin that allows me to just configure the URL that I wish to show on each screen. Plus, Sometimes we split the each screen into 2 or more webpages.
Is there any web app, chrome plugin or web service that allows me do that?
Thanks
OBS, I don't know if here is the right place to this kind of question. If is there another community where i could ask this, i will be glad to know.
I can not give a complete and exhaustive answer, since you do not provide any description of how it should look and how you want to control it.
Let's start with the fact that almost every browser at startup you can specify URL and start the browser like this:
# firefox https://google.com
Then the browser opens with the page you need.
To close the page, you can kill the browser with a command like this
# killall firefox
You can run commands on the Raspberry PI using ssh, it's much easier than running the VNC session.
Most likely you may encounter a problem when you receive a message stating that the browser can not connect to the display. This is easily correctable with something like:
# export DISPLAY=:0
In order for the browser to always be in full-screen mode and not to lose its settings, you can configure it correctly, close all the tabs and save its configuration from ~/.mozilla/ (for firefox), and then restore it from backup every time you start it.

Desktop capture - Does not show all windows during sharing contents of Desktop

Here is the link to my extension code:
Trying to capture desktop image using getUserMedia and canvas
The problem is that when I use :
chrome.desktopCapture.chooseDesktopMedia(["screen", "window"],onAccessApproved);
It asks me to share contents of my screen. But it doesn't show all windows that are active on my desktop.
Example: Sometimes my skype is minimised and if click the extension icon it opens a sharing panel and asks me to share desktop contents but skype window is not shown in this panel. If I click on skype from my task bar, the sharing panel shows skype. Reason for this behaviour?
How to show all my windows on sharing screen?
Well, the behavior is consistent: on Windows, minimized windows are not shown as eligible capture targets. There is no way around it.
This limitation is not documented, which is regrettable; it may also be OS-specific.
Specifically, Windows implementation contains the following comment:
// Skip windows that are invisible, minimized, have no title, or are owned,
// unless they have the app window style set.
Interestingly, this seems more like a Mac limitation than a Windows one:
// Return a 1x1 black frame if the window is minimized, to match the behavior
// on Mac.

How is the panel displayed when launching Chrome Hangout extension made to be always on top and pinned?

When launching the Chrome Extension Google-Hangouts, a panel initially appears that lists members and a link/button to create a new Hangout.
This panel is initially pinned to the bottom right of the browser window. When pinned like this, it remains always on top as a browser navigation session continues: users can go to different URLs, change tabs, etc. and that panel stays at the bottom right and stays on top of all other windows (or at least on top of the main browser window).
Once it's unpinned, you can drag it around the window, but it no longer stays always on top.
My question is, how was that achieved - what code, or what functions, do i need to call to create that window/panel so that it stays initially pinned and always on top? Is there some binding to some native code that's involved? Some other approach?
If anyone know and can show or explain, i would be hugely grateful as this feature is key to an extension i'm trying to build.
Thanks a lot!
This may not be an answer but to get a clue of what is happening I extracted the crx file to view its content there are a few OS specific files : ace.dll , libace.so and ace. After researching a bit i found this. This is a plugin. Hangouts extension is using ace plugin which is actually running on your desktop(i'm not sure about this). You can check this article
I found this related post: How to build an chrome extension like Google Hangouts
ACE is actually not what makes the window, Chrome has that capability built in, apparently. Even if you don't enable panels, extensions from Google can still make them, provided your OS is capable.

why is my website resizing browser windows

I have had a report that my company's website is resizing at least one employee's browser windows. I experienced this behavior myself on the user's computer, and it was mystifying because the resizing only occurred on our site, not on any other site, and it occurred on both Firefox and Internet Explorer. The user has a Windows 7 machine running updated software. She has no add-ons, themes, or plugins besides the usual (Flash etc.) and her settings are the factory defaults. I cleared the browser cache on both browsers and restarted the computer and it still occurred. The only thing left is the css, but none of it seems suspicious to me.
What is happening is, when she clicks a button or internal link on the site, then when the new page finishes loading, the browser window resizes to approximately 80% of the width of the content. That is, the very last thing the page does as it loads is to resize itself. If she zooms in or out, then on the next load, it again resizes to 80% or so of the smaller or larger size of the content. If she maximizes and then loads a page, then the window resizes to 80% but somehow maintains the "maximized" icon. (You then have to click twice on the "maximized" icon to maximize.)
The reason I am flummoxed is that I thought this kind of behavior was something you could only do with JavaScript, but I deliberately tested this with pages that had no JavaScript at all and it still occurred. There is exactly one page on the website that has browser-resizing JavaScript on it, but it resizes to a pixel size, not a percentage, and it's part of a web service that wasn't in use while I was testing.
What kinds of things should I investigate to solve this issue? Because this is an employee, I have to either fix the website or fix her computer, so ideas for investigating both would be great.
The problem turned out to be that single page with browser-resizing JavaScript I mentioned. Another set of pages had needed some JavaScript functions from that web service, so one person had copy-and-pasted the functions that were needed. Then someone else came along, noticed that the copy-pasting was a dumb idea, and decided to simply include the JavaScript file that had those functions instead.
The problem was, the command to resize the window was bare in that file. For that one user, that command was being carried out and resizing every window. For everyone else, their browsers were ignoring the resize command except on the web-service popup window. I can only assume she had the problem because she had factory-standard settings, and the rest of us didn't. To fix the problem, I moved the resize command from the JavaScript file to the head of the web service page.

Chrome extension performance

I have developed a chrome extension. The extension itself works fine and fast.
But when I start the browser and click on the toolbar icon of my extension it takes about 2 seconds for the popup to appear and to show its content (this happens anytime the browser is restarted).
Any idea what causes this and how to fix that?
Tip 1:
Use your popup page for rendering exclusively. It should be as light as possible. All the heavy loading/processing (localStorage, XMLHttpRequests, blocking javascript) must be done in the background page.
The background page is loaded when Google Chrome starts. Basically, it allows you to execute code and keep a page always running (although the popup is not present). For instance, streaming audio in a html5 tag with no popup.
Note: If you are not using a background page yet, you should be taking a look to message passing first.
Tip 2: Warning: This could fail
I haven't tested this yet, but maybe using the HTML5 manifest.cache can help you preventing loading again resources stored locally. But beware, this is HTML5 and is prone to changes and unstability across versions. (also, I am not completely sure that the cached resources will be loaded in memory before the popup is opened)
Hope it helps!

Resources