I guess there is no other protection than the regular copyright and patent laws.
I hope that the HTML Encrypted Media Extensions can be used to protect and hide code as well.
Even if it means hardware side restrictions.
My hope for protection concerns mainly product piracy by users and not piracy by competing companies.
Other programmers can easily copy simple products and ideas without stealing code.
Furthermore, cloud companies might not be interested in empowering the browser to become a decentralized P2P platform for everything.