Recently there have been quite some discussions about the security approach of ProtonMail. Since it do crypto stuff at client-side, loading the javascript code in the user's browser, as far as i know, even if that code is published somewhere in the internet, there is no guarantee that it has not been manipulated by an evil entity with admin access to the server before user actually use it.
So, generally speaking the question is: how can i develop open source software and let the end user to verify if the code behind that software is the same published?
In case of compiled software i can use signed reproducible builds, but in case of interpreted code (for example JavaScript as in ProtonMail) what can i do?
From my very basic knowledge of programming and cryptography, i would try to solve this situation adding to the published code the fingerprint of, let's say, each source file. That fingerprint should also be signed by the developer. At this point when the user download the code while accessing to the web service, he can calculate the fingerprint and compare it against the public one. Does it is viable approach? Am i missing something?
Thanks in advance!
P.S. I have already read some other questions like this one and i think they still not fully answer to this question.