After a few minutes of working with the Chrome developer tools, I decided not to go through the source code using the debugger, but to study the behavior of the button with control points (the Sources panel) and some educated assumptions.
In short, Hangouts can be disabled (un) by triggering the following events in that order:
mousedown - To activate a buttonmouseup - To start the associated click handlermouseout - To remove the focus ring from the button (optional).
To select the target element, I did not use the selector that you provided, because it will not work for the localized (non-English) Hangouts interface. Instead, I aim the CSS class on the microphone icon and select its container (button), "ha-wPy-Xi-f".
Finally, use the MouseEvent constructor (DOM4) and dispatchEvent to switch the microphone in Hangouts:
var el = document.querySelector('.ha-wPy-Xi-f').parentNode; el.dispatchEvent(new MouseEvent('mousedown')); el.dispatchEvent(new MouseEvent('mouseup')); el.dispatchEvent(new MouseEvent('mouseout'));
source share