I am using chrome with the MetaMask plugin installed. When I launch the below HTML file and look at the JS console, MetaMask doesn't inject web3 ("MetaMask - injected web3") like it does on every other webpage. What am I missing here / how much configuration does it take to get MetaMask to inject web3.js?
<!DOCTYPE html>
<script>
window.addEventListener('load', function() {
// Checking if Web3 has been injected by the browser (Mist/MetaMask)
if (typeof web3 !== 'undefined') {
// Use Mist/MetaMask's provider
window.web3 = new Web3(web3.currentProvider);
} else {
console.log('No web3? You should consider trying MetaMask!')
// fallback - use your fallback strategy (local node / hosted node +
in-dapp id mgmt / fail)
window.web3 = new Web3(new
Web3.providers.HttpProvider("http://localhost:8545"));
}
// Now you can start your app & access web3 freely:
startApp()
})
</script>