api/labs/easyrtc_sc_extension/background-script.js
function onAccessApproved(sourceId) {

        pending = false;
        
        // if "cancel" button is clicked
        if(!sourceId || !sourceId.length) {
            return port.postMessage('PermissionDeniedError');
        }
        
        // "ok" button is clicked; share "sourceId" with the
        // content-script which will forward it to the webpage
        port.postMessage({
            chromeMediaSourceId: sourceId
        });
    }
function onAccessApproved(sourceId) {

        pending = false;
        
        // if "cancel" button is clicked
        if(!sourceId || !sourceId.length) {
            return port.postMessage('PermissionDeniedError');
        }
        
        // "ok" button is clicked; share "sourceId" with the
        // content-script which will forward it to the webpage
        port.postMessage({
            chromeMediaSourceId: sourceId
        });
    }
function onAccessApproved ( sourceId ) { pending = false ; // if "cancel" button is clicked if ( ! sourceId || ! sourceId . length ) { return port . postMessage ( 'PermissionDeniedError' ) ; } // "ok" button is clicked; share "sourceId" with the // content-script which will forward it to the webpage port . postMessage ( { chromeMediaSourceId : sourceId } ) ; }
on getting sourceId "sourceId" will be empty if permission is denied.
on getting sourceId sourceId will be empty if permission is denied .