Skip to content

Instantly share code, notes, and snippets.

@andreiashu
Created October 20, 2021 03:45
Show Gist options
  • Save andreiashu/c2ab31624d9ab34851fcfa11b884fcdd to your computer and use it in GitHub Desktop.
Save andreiashu/c2ab31624d9ab34851fcfa11b884fcdd to your computer and use it in GitHub Desktop.
Load Web3 within browser console
// 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