I’ve looked for solutions, but couldn’t find any that work.
I have a variable called onlyVideo.
onlyVideo
\"onlyVideo\" the string gets passe
\"onlyVideo\"
If it's a global variable then window[variableName] or in your case window["onlyVideo"] should do the trick.
window[variableName]
window["onlyVideo"]