Open Ronald-Diemicke opened 1 year ago
I was thinking the same thing. You can do it the following way, but it's not that practical, having an UI would make it a lot easier to edit.
// Bite code from https://stackoverflow.com/a/950146/6227108
function dynamicallyLoadScript(url) {
var script = document.createElement("script"); // create a script DOM node
script.src = url; // set its src to the provided URL
document.head.appendChild(script); // add it to the end of the head section of the page (could change 'head' to 'body' to add it to the end of the body section instead)
}
// example
dynamicallyLoadScript('https://cdn.jsdelivr.net/momentjs/2.17.1/moment.min.js')
It would be nice to select if it is type="module" in the options too
So - I recently realized I could use a feature where I could actually give RO a URL and have it add it to the page as a new script file or CSS file - so I could test a script I've got hosted elsewhere on a page BEFORE I commit to adding it...