'Security Issues: Injecting web3js into the window object of HTML
So I recently started learning web3js (using it with angular). And since using web3js with angular through the npm package is a bit cumbersome I was instead using a web3js cdn and injected it into the window object of my HTML (at the and of the body). Like this:
<script>
if (typeof window.ethereum !== "undefined") {
window.web3 = new Web3(window.ethereum);
}
</script>
I was wondering if there are any security issues doing it like this? Should I stop doing it? I sadly couldn't find any information online regarding this topic. Also is it bad in general when I inject stuff into the window object or is it fine?
Was googling few hours but couldn't find any useful information.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
