Fix content security policy problems with my userscript

Job ID: 32364647

Budget: $10 – $30 USD

I use a script in Tampermonkey to click on YouTube links in a page and watch them inline without having to open tabs. The script works mostly OK but some sites are having problems related to CSP. Instead of getting a video, I get a message "This content is blocked. Contact the site owner to fix the issue." I need your help so that I can watch videos inline again without that message and without opening tabs


## Setup:
Chrome browser
Tampermonkey chrome extension https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo/related?hl=en
YouTube Link Title userscript https://github.com/azizLIGHT/youtube-link-title/blob/master/YouTube-Link-Title.user.js


## It works on reddit:
https://old.reddit.com/r/AskReddit/comments/8rhb6d/whats_a_video_on_the_internet_that_had_you/
click on any youtube link in the page


## It doesn't work on duckduckgo.com:
https://duckduckgo.com/?q=test+video&iax=videos&ia=videos
Clicking any youtube link on those two pages opens the inline embedded video player, but there is a gray error message saying "This content is blocked. Contact the site owner to fix the issue."

The console shows error:
Refused to frame 'https://www.youtube.com/' because it violates the following Content Security Policy directive: "frame-src blob: https://duckduckgo.com https://*.duckduckgo.com https://3g2upl4pq6kufc4m.onion/ https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/".


## It doesn't work on brave search:
https://search.brave.com/videos?q=test%20video
Clicking any youtube link on those two pages opens the inline embedded video player, but there is a gray error message saying "This content is blocked. Contact the site owner to fix the issue."

The console shows error:
Refused to frame 'https://www.youtube.com/' because it violates the following Content Security Policy directive: "default-src 'self' https://*.search.brave.com". Note that 'frame-src' was not explicitly set, so 'default-src' is used as a fallback.


If you can get this working then I have another idea I need help with: Replacing the YouTube embeds with Invidious embeds. Thank you for looking
Related categories: JavaScript YouTube Firefox Google Chrome