Defer parsing of Javascript


I found the following snippet in another post here and it seems to work pretty good on the front end of a site I’m putting together. Unfortunately, it is breaking the editor on the backend of the site. Can anyone suggest a way to get this to apply to the frontend but not the backend?

//Defer Parsing JS
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return "$url' defer ";
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );