Skip to content

Instantly share code, notes, and snippets.

@andreiashu
Created October 20, 2021 04:03
Show Gist options
  • Save andreiashu/fc12e3900cf79b55bb2a9db9cfcd8041 to your computer and use it in GitHub Desktop.
Save andreiashu/fc12e3900cf79b55bb2a9db9cfcd8041 to your computer and use it in GitHub Desktop.
Load ethers in 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://cdn.jsdelivr.net/npm/ethers@5.5.0/dist/ethers.umd.js');
// @TODO: this can fail on slow connections; should have a retry mechanism
setTimeout(() => {
console.log(`Loaded ethersjs version: ${ethers.version}`);
}, 1500);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment