getUserMedia supports screen escaping, not just tab contents.
I did a screen demo (using the mandatory chromeMediaSource: 'screen' constraint) that passes the stream to RTCPeerConnection: https://simpl.info/screencapture .
The chrome.tabCapture API gets the contents of the tab, but of course this is not what you want: the example is here (although the code is now broken).
EDIT: Added HTTPS to links: this is required for screencapture.
Sam dutton
source share