I've been experimenting with a way to circumvent wifi network password screens, and found myself needing to inject jQuery into a page without having an Internet connection (see jquerify otherwise). Here's what I did in Chrome:
- Enable developer mode
- Add a new directory on your computer, add a "manifest.json" file to it, along with any JS you want to load (eg https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js) and add the following to the manifest.json file:
"name": "File holder",
- Go to chrome://extensions/ in Chrome
- Click "Load unpacked extension" and select your folder
- Note the "ID" from your new extension. This is how you'll load files from it.
var element1 = document.createElement("script");
element1.src = "chrome-extension://aaaabbbbccccdddd/jquery.min.js"; // use your extension's ID
That will allow you to use jQuery without having an internet connection.