There is a proposal to add JavaScript checksum verification to Browsers: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity#Subresource_Integrity_with_the_script_element