Skip to content

Fix YouTube import by replacing eval with JSON.parse#25

Open
thatrobotdev wants to merge 1 commit intoRustyNova016:mainfrom
thatrobotdev:fix-yt-script
Open

Fix YouTube import by replacing eval with JSON.parse#25
thatrobotdev wants to merge 1 commit intoRustyNova016:mainfrom
thatrobotdev:fix-yt-script

Conversation

@thatrobotdev
Copy link

@thatrobotdev thatrobotdev commented Mar 5, 2026

The YouTube import script is currently broken because calls to eval() are forbidden by YouTube's CSP settings. This is because eval() can execute arbitrary code, which is unnecessary with this call because we are just parsing the JSON response.

So, this switches to the safer and effective JSON.parse, which fixes #17.

The script is currently broken because calls to eval() are forbidden by YouTube's CSP settings. This is because eval() can execute arbitrary code, which is unnecessary with this call because we are just parsing the JSON response.

So, we switch to the safer and effective JSON.parse, which fixes the issue.
@thatrobotdev thatrobotdev changed the title Replace eval with JSON.parse for safer parsing. Fix YouTube import by replacing eval with JSON.parse Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

youtube: this document requires 'Trusted Type' assignment error

1 participant