[BUG] Crash when playing uploaded video: Extension context invalidated and VideoFrame was garbage collected without being closed
Platform
win 11
Browser
Chrome
Current Behavior
The application crashes when trying to play an uploaded video.
The browser console repeatedly logs:
Uncaught (in promise) Error: Extension context invalidated.
A VideoFrame was garbage collected without being closed.
Video playback does not work.
Expected Behavior
No response
Recurrence Probability
Always
Steps To Reproduce
-
Open the application in the browser.
-
Upload a video file.
-
Attempt to play the uploaded video.
-
Observe the browser console.
-
The application crashes and the listed errors appear.
Anything else?
Bug Description When trying to play an uploaded video, the app crashes. In the console, I see two recurring errors:
Uncaught (in promise) Error: Extension context invalidated.
This seems to happen when the app tries to call wrappedSendMessage from polyfill.js. Possibly the extension/content script context is being invalidated while video playback is active.
A VideoFrame was garbage collected without being closed.
This indicates that VideoFrame objects are not being properly closed after use. According to the WebCodecs API, .close() must be called to release resources.
Steps to Reproduce
Upload a video
Try to play it
Observe console logs and crash
Expected Behavior
Video should play without crashing
VideoFrame resources should be released properly
Console Output
Uncaught (in promise) Error: Extension context invalidated. at polyfill.js:518:25 ... A VideoFrame was garbage collected without being closed.
Possible Fixes
Ensure .close() is called on every VideoFrame once processing is done
Investigate why wrappedSendMessage is called after the extension context is invalidated
I also crashed Chrome when playing the video.