Usage example:
https://commons.wikimedia.org/wiki/User:Aavindraa/common.js
The rolling release will update automatically.
Use the other option if you want a specific version.
Set it up once, and you might just need to do a hard reload occasionally to download the new scripts.
Any of the below can be used as the src
value:
- https://cdn.jsdelivr.net/gh/avindra/mikiwedia@main/index.js (CDN jsdelivr)
- https://avindra.github.io/mikiwedia/index.js (GitHub Pages)
- https://dra.vin/mikiwedia/index.js (GitHub Pages via my domain)
By using jsdelivr, you can specify a version to use. For example, you could pick the 0.2.0
release. Note: don't actually use v0.2.0 as it has known bugs.
This is the code to use in your common.js
.
In Firefox/Chrome: ctrl
+shift
+i
to use developer console.
const s = document.createElement("script");
s.type = "module";
s.src = '//dra.vin/mikiwedia/index.js';
document.body.appendChild(s);
Local testing looks more like:
var l = document.createElement("script");
l.type = "module";
l.src = 'https://localhost:8000/index.js';
document.body.appendChild(l);
- ES Modules
- Don't add third-party libraries
- Limit use of jQuery and builtins
- Lazy-load bigger modules with dynamic imports
In lieu of an actual feature list, check releases
for now: