Created
October 20, 2021 03:45
-
-
Save andreiashu/c2ab31624d9ab34851fcfa11b884fcdd to your computer and use it in GitHub Desktop.
Load Web3 within browser console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste this in your browser's console | |
(function() { | |
_loadScript = function(path){ var script= document.createElement('script'); script.type= 'text/javascript'; script.src= path; document.head.appendChild(script); } | |
_loadScript('https://cdnjs.cloudflare.com/ajax/libs/web3/1.6.1-rc.0/web3.min.js'); | |
// @TODO: this can fail on slow connections; should have a retry mechanism | |
setTimeout(() => { | |
console.log(`Loaded Web3 version: ${Web3.version}`); | |
}, 1500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment