Stops stuck video previews on YouTube after middle-click or right-clicking a video to open it in a new tab.
Stuck Preview Fix fixes a YouTube desktop bug where an inline video preview can keep playing on the original page after you open that video in a new tab.
This commonly happens when using middle-click on a video thumbnail or title, or when using the browser's right-click → Open link in new tab option.
Normally, the behavior looks like this:
Clicking an empty area of the page usually stops the preview manually.
This script performs the required cleanup automatically.
The problem can appear on pages such as:
There are no settings or buttons to configure.
When you middle-click or right-click a video that has an active preview, the script automatically performs the cleanup in the background.
Prefer a normal browser extension instead of a userscript manager?
Stuck Preview Fix is also available as a Manifest V3 browser extension
for Chrome, Microsoft Edge, and other Chromium-based browsers.
The extension and userscript use the same core fix and are maintained together as an open-source project.
Source code, extension downloads, releases, documentation, and bug reports:
https://github.com/sameraskar/Stuck-Preview-Fix-for-YouTube
You can download the latest packaged browser extension from the project's GitHub Releases page, or inspect and build the complete source code yourself.
Stuck Preview Fix is intentionally small and privacy-friendly.
Everything the script does happens locally in your browser on YouTube pages.
YouTube appears to use internal interaction state to control thumbnail previews.
Normal left-click navigation clears that state, but middle-click and the browser's native context menu can bypass part of YouTube's normal cleanup process.
The result is a preview that remains active even though the video was opened in another tab.
Stuck Preview Fix does not modify YouTube's internal application code. Instead, it performs a small local cleanup after the relevant mouse interaction.
Designed for desktop YouTube with modern browsers, including:
The userscript should also work with other browsers that support compatible userscript managers, although not every browser/version has been tested.
YouTube frequently changes its page structure, so a future YouTube update may require this project to be adjusted.
If the fix stops working, please report the problem on GitHub:
Please include:
Open source:
The complete source code for both the userscript and browser extension is publicly available on GitHub.
Bug reports, pull requests, and improvements are welcome.
View Stuck Preview Fix on GitHub
This project is an independent utility and is not affiliated with, endorsed by, or sponsored by YouTube or Google.