code: function portOnMessageHanlder(message) {
          if(message === 'get-sourceId' && !pending) {
              pending = true;
              chrome.desktopCapture.chooseDesktopMedia(session, port.sender.tab, onAccessApproved);
          }
      }
docs: this one is called for each message from "content-script.js"