This is a great question, and I think the answer is "unfortunately you cannot."
It would be interesting to implement some kind of cryptographic hash like the ones Chrome uses to check extension files, but this is not a very strong guarantee.
Consider (all this is hypothetical):
- You can easily save the registry entry / manifest in this way, but what about the file itself?
- Suppose you attach a hash of an executable file, then it becomes painful to update it (you will also have to update the extension in synchronization too). It can be resolved using some kind of public key signature, but instead of a hash.
- Suppose you write an executable file in a manifest. How is its data files? More importantly, what about the libraries that the native application uses?
Protecting your Chrome extension / application is easy because the only "library" / runtime you rely on is Chrome itself (and you trust that). Your own application can depend on many, many things in the system (for example, the already mentioned libraries), how do you track?
Anyway, this seems interesting for a brainstorming session. Check out Chrome's error tracker , if there is something similar, if not, try raising a feature request. Perhaps try the chrome-related mailing list to ask the developers.
source share