dufferzafar / Userscripts

A collection of scripts that make spending time on the web easy.
GNU General Public License v3.0
63 stars 27 forks source link

Replace eval() with JSON.parse() #10

Closed augustjanse closed 7 years ago

augustjanse commented 7 years ago

Fixes #8. Not sure why the $.parseJSON() line was commented out, but apparently it is deprecated with jQuery 3.0, so I replaced both lines with its successor.

Error fixed:

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' *.apple.com".

    at callbackFunction (<anonymous>:70:45)
    at XMLHttpRequest.xmlhttp.onreadystatechange (<anonymous>:63:47)
augustjanse commented 7 years ago

For the record, the eval() has been there since the script was imported.

dufferzafar commented 7 years ago

Thanks a lot @augustjanse