The real problem is more that bad and malicious code get more and more easier to deploy, the browser getting more complex to mitigate this.
The good news is that the level of trust in the code to run app natively is very high, and in the age of highly connected computers, if not done in the browser, it would have been needed at OS level anyway.
So maybe browser looks like a sad future as an OS replacement, but at least, it collected issues and solutions to mitigate arbitrary code loaded from the networks.
Whatever happens after, this history will be kept. (it has already started on current OSes with sandboxed software and on demand permissions).
The good news is that the level of trust in the code to run app natively is very high, and in the age of highly connected computers, if not done in the browser, it would have been needed at OS level anyway.
So maybe browser looks like a sad future as an OS replacement, but at least, it collected issues and solutions to mitigate arbitrary code loaded from the networks.
Whatever happens after, this history will be kept. (it has already started on current OSes with sandboxed software and on demand permissions).