Record current tab in chrome using chrome extension and getUserMedia()

I am trying to make a Chrome extension to record user activity in the current tab.

I found out that I can use getUserMedia() on the front, and chrome.desktopCapture in my background script.

However, when I try to use chrome.desktopCapture.chooseDesktopMedia([‘tab’], onApproved), I get prompted for the tab I want to share. However, I would like to skip this step and share my current tab without the prompt.

I know that this can be done, because in the Screencastify Chrome extension, you can do that. The first option is to record the current tab and no popups are displayed.

Recorded video can’t be forwarded/backwarded, Using MediaRecorder API chrome extension

I am implementing a chrome extension which records the screen with microphone and after recording it generates the recorded video perfectly but the problem is that the recorded video can not be forwarded/ backwarded or start video from any point first time.

When it plays the first time after that it works perfectly but when I download this video then the problem is same. I take help from muaz khan plugin.

I am using this code for start recording:

function gotStream(stream) {

    if (cameraStream && cameraStream.getAudioTracks().length) {
        cameraStream.getAudioTracks().forEach(function(track) {
            // cameraStream.removeTrack(track);
            stream.addTrack(track);
        });
    }

    if (typeof MediaRecorder.isTypeSupported == 'function') {
        /*
         MediaRecorder.isTypeSupported is a function announced in https://developers.google.com/web/updates/2016/01/mediarecorder and later introduced in the MediaRecorder API spec http://www.w3.org/TR/mediastream-recording/
         */
        if (MediaRecorder.isTypeSupported('video/mp4;codecs=h264')) {
            var options = {
                type: 'video',
                mimeType: 'video/mp4;codecs=h264'
            };
        } else if (MediaRecorder.isTypeSupported('video/webm;codecs=vp9')) {
            var options = {
                type: 'video',
                mimeType: 'video/webm;codecs=vp9'
            };
        } else if (MediaRecorder.isTypeSupported('video/webm;codecs=vp8')) {
            var options = {
                mimeType: 'video/webm;codecs=vp8'
            };
        }
        console.log('Using ' + options.mimeType);
        recorder = new RecordRTC(stream, options);
    } else {
        console.log('Using default codecs for browser');
        recorder = new MediaRecorder(stream);
    }

    recorder.streams = [stream];
    recorder.start(10);

    recorder.ondataavailable = function(e) {
        chunks.push(e.data);
    };

    recorder.onerror = function(e) {
        console.log('Error: ', e);
    };

    recorder.onstart = function() {
        isRecording = true;
        onRecording();
        console.log('Started & state = ' + recorder.state);
    };

    recorder.onpause = function() {
        console.log('Paused & state = ' + recorder.state);
    }

    recorder.onresume = function() {
        console.log('Resumed  & state = ' + recorder.state);
    }

    recorder.onwarning = function(e) {
        console.log('Warning: ' + e);
    };

    recorder.onstop = function() {
        stopScreenRecording();
    }

    stream.onended = function() {
        if (stream) {
            stream.onended = null;
        }
        recorder.stop();
    };

    if (stream.getVideoTracks().length) {
        stream.getVideoTracks().forEach(function(track) {
            track.onended = function() {
                if (!recorder) return;
                if (!stream || typeof stream.onended !== 'function') return;
                stream.onended();
            };
        });
    }
}

and this for stop recording:

function stopScreenRecording(blob) {
    isRecording = false;

    var blob = new Blob(chunks, {
        type: "video/mp4"
    });
    chunks = [];


    var file = new File([blob ? blob : ''], getFileName(fileExtension), {
        type: mimeType
    });

    DiskStorage.Store({
        key: 'latest-file',
        value: file
    }, function(success) {
        if (success) {
            chrome.browserAction.setPopup({
                popup: "popup.html"
            });
            chrome.tabs.create({
                url: 'preview.html'
            });
        }
    });

    setTimeout(function() {
        setDefaults();
        // chrome.runtime.reload();
    }, 1000);

    try {
        videoPlayers.forEach(function(player) {
            player.src = null;
        });
        videoPlayers = [];
    } catch (e) {}

    // for dropdown.js
    chrome.storage.sync.set({
        isRecording: 'false' // FALSE
    });

    if (timer) {
        clearTimeout(timer);
    }
    setBadgeText('');
}

I saw another screen recorder whose video blob is like:

filesystem:chrome-extension://mmeijimgabbpbgpdklnllpncmdofkcpn/persistent/e6ad7ba1-6afe-4d45-y6f5-47e08a87e036.webm

and our video blob is like:

blob:chrome-extension://hgpenkfjeddjngnojmcmgbclkoakihhg/af3dcfa6-b990-464b-9726-e8b6022762a2

How can I get this type of blob?