1

hello everybody I'm building a chrome extension for catching screen records and edit them, I'm trying to use the chrome tab capture API for getting video stream in the content script and I'm getting an undefined error I am using manifest version 3 I set in the manifest the tab capture permission hare is a sample trying to run in the content script

chrome.tabCapture.capture(
  {
    video: true,
    audio: true,
    videoConstraints: {
      mandatory: {
        chromeMediaSource: "tab",
        minWidth: width,
        minHeight: height,
        maxWidth: width,
        maxHeight: height,
        maxFrameRate: fps,
      },
    },
  },
  (stream) => {
    console.log(stream);
  }
);

and manifest

  "permissions": [
    "activeTab",
    "storage",
    "identity",
    "downloads",
    "scripting",
    "tabCapture"
  ],
  • 2
    You can use it inside an extension iframe added to the page, [example](https://stackoverflow.com/a/25100953). The iframe can transfer data to the main page via parent.postMessage() – wOxxOm Jul 25 '21 at 09:06

0 Answers0