It appears that Unity is still capturing mouse input when the mouse is outside of the web plug-in. For instance, if I have an html button control (within the webpage) and I click it, Unity is still registering that I clicked the mouse. Is there anyway to make unity only register mouse clicks when the plug-in application has focus?
You can add an extra check for mouse screen position to stop it registering clicks outside of the window
Can you describe what setup you are using? Which browser? Which mouse? and how are you polling the mouse? Safari 4 on OS X 10.6 has some known bugs with respect to focus handling (which we cannot work around).
However, in any browser, using the GUI events (see Event class), you should only get clicks inside the plug-in view. Input.GetMouseButton() may be different in some cases.
Maybe you can try OnApplicationFocus or OnApplicationPause?
Source : Web Player ignore input if doesn't have focus - Questions & Answers - Unity Discussions