Okay I have been working on this for a couple of days now, and have come up with the cleanest dirty hack I could.
The idea is to have the browser tell unity when it’s focus:
<script language="javascript1.1" type="text/javascript">
function onBlur()
{
GetUnity().SendMessage("BrowserWindow", "WindowFocusOut", " ");
}
function onFocus()
{
GetUnity().SendMessage("BrowserWindow", "WindowFocusIn", " ");
}
// check for Internet Explorer
if (navigator.appName == "Microsoft Internet Explorer")
{
document.onfocusin = onFocus;
document.onfocusout = onBlur;
}
else
{
document.onfocus = onFocus;
document.onblur = onBlur;
}
</script>
Now we have to have a game object named BrowserWindow, with a script with methods called WindowFocusIn and WindowFocusOut that take a string.
using UnityEngine;
using System.Collections;
public class BrowserWindow : MonoBehaviour
{
//gameobjects to get the scripts that need disabling!
public GameObject gameobject;
private fooBarScript;
private bool focus;
private bool debug;
private string logText;
public bool Focus { get { return focus; } set { focus = value; } }
// Use this for initialization
void Start()
{
focus = true;
debug = false;
fooBarScript= (fooBarScript)gameObject.GetComponent(typeof(fooBarScript));
// to test that we actualy have something, for editor testing
fooBarScript.enabled = true;
}
// OnGUI is called once per event
void OnGUI()
{
if (!focus)
{
//Gui magic to avoid gui events
GUI.depth = 0;
GUI.backgroundColor = new Color(1f, 1f, 1f, 0.25f);
GUI.color = Color.black;
GUI.Button(new Rect(0, 0, Screen.width, Screen.height), "Pause..");
}
if (Debug)
{
GUI.Label(new Rect(0, 5, 140, Screen.height - 200), logText, "button");
}
}
//this is called when the window we are in looses focus, but the window can loose focus to us the webplayer.
public void WindowFocusOut(string arg)
{
//if the mouse cords are inside us, and the window lost focus, we have the focus
if (new Rect(0, 0, Screen.width, Screen.height).Contains(new Vector2(Input.mousePosition.x, Input.mousePosition.y)))
{
WindowFocusIn(arg);
return;
}
logText += "Out\n";
focus = false;
//disable all your scripts.
foobarScript.enabled = false;
}
public void WindowFocusIn(string arg)
{
logText += "In\n";
focus = true;
//enable all your scripts.
foobarScript.enabled = true;
}
}
tried to generalise the code, so it’s useable by whom ever 
Now we just disable every thing that needs to be disabled, and no more shooting friends while in another tab 
But still, UT I really hope you come with a proper fix, keyboard kontrol trough tabs are fine, mouse should be to 