This is just a separate post to modifying linked resources to HTTPS when using DOM.
jQuery( document ).ready(function($) {
// This will find links for `href` attributes and substitute url value
str.replace(/(href[^http://]+)(?<=['\"])http(?=://)/gi, "$1https")
// This will look for `src` attributes particularly images, JS scripts and replace the URL value
str.replace(/(src[^http://]+)(?<=['\"])http(?=://)/gi, "$1https");
// Find forms and look for `action` attributes and replace url value
str.replace(/(action[^http://]+)(?<=['\"])http(?=://)/gi, "$1https");
});
Feel free to comment below;