Skip to content

Instantly share code, notes, and snippets.

@Saw-mon-and-Natalie
Created September 27, 2019 06:38
Show Gist options
  • Save Saw-mon-and-Natalie/d735540d60ee28a400031562f871cfb6 to your computer and use it in GitHub Desktop.
Save Saw-mon-and-Natalie/d735540d60ee28a400031562f871cfb6 to your computer and use it in GitHub Desktop.
javascript code snippet to use to load external JS libraries inside chrome dev tools console

How to import external JS libraries in Chrome dev tools console

fetch('link-to-external-js-library')
    .then(response => response.text())
    .then(text => eval(text))

example, loading lodash:

fetch('https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js')
    .then(response => response.text())
    .then(text => eval(text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment