Are you still there?!?

YES … well, no, but YES!

At Novoda we use Google Hangouts for communication between our London and Berlin office and also for connecting people when working remotely.

We aim to always have our hangout in the London office live so anyone can connect and see what’s going on. The problem comes because if you leave a Google Hangout running for ~2 hours it brings up a dialog asking “Are you still there?”. If you don’t click “ok” it will disconnect you from the hangout.

The Keep alive screen

Solution (Chrome variant)

There is a nice Chrome plugin called “Ninja Script”. This allows you to run javascript when a specific URL is loaded. i.e. when you connect to the Hangout, you can run some javascript that will click the ‘ok’ button when it appears, yay!

Ninja scripting

After you have installed the plugin, click the blue cross on your Chrome bar. Press the ‘new’ button at the bottom. Give it a name and description, paste the javascript from below. Finally press the “Autorun” button, here you can paste https://plus.google.com/hangouts and then this script will run automatically when you start or join a new hangout. Done! One caveat, this plugin is a bit flaky in its UI (but once setup runs great). If you find you cannot click some of the buttons go into your Chrome settings and disable and re-enable the plugin.

Here is a script to solve the problem!
Thanks to spencerelliott on userscripts.org userscripts.org

What you now see

For convenience, the script is below (v1.0.8)

	(function()
	{

		function addJQuery(callback)
		{
    		var script = document.createElement("script");
    		script.setAttribute("src","https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js");
    		script.addEventListener('load', function()
    		{
      			var script = document.createElement("script");
      			script.textContent = "(" + callback.toString() +")();";
      			document.body.appendChild(script);
    		}, false);
			document.body.appendChild(script);
 		}

  		function checkForPrompt()
  		{
    		function simulate(target, evtName)
    		{
				evt = document.createEvent("MouseEvents");
      			evt.initMouseEvent(evtName, true, true,document.defaultView, 0, 0, 0, 0, 0, false, false,false, false, 0, target);
      			target.dispatchEvent(evt);
			}

    		function simulateClick(target)
    		{
      			simulate(target, "mouseover");
      			simulate(target, "mousedown");
      			simulate(target, "mouseup");
      			simulate(target, "mouseout");
    		}

    		$('div[role="button"]').each(function(idx, item) // For each div with attribute role = "button"
    		{
      			if ($(item).html().indexOf("Yes") >= 0) // Correct button found
      			{
        			simulateClick(item);
      			}
    		});

    		setTimeout(checkForPrompt, 6000); // Repeat every 6 seconds
		}

		function init()
		{
			addJQuery(checkForPrompt);
		}

		setTimeout(init, 6000); // Start after 6 seconds
		alert("Keep Alive Script Running");

	})();

Here is the original script .