//sample.js window.onload = function () { var setInnerHTML = function (elm, html) { elm.innerHTML = html; Array.from(elm.querySelectorAll("script")).forEach(oldScript => { const newScript = document.createElement("script"); Array.from(oldScript.attributes) .forEach(attr => newScript.setAttribute(attr.name, attr.value)); newScript.appendChild(document.createTextNode(oldScript.innerHTML)); oldScript.parentNode.replaceChild(newScript, oldScript); }); }; fetch(YOUR_URL_IN_HERE) .then(function (response) { return response.text(); }) .then(function (body) { var dv = document.createElement('div'); setInnerHTML(dv, body); //dv.innerHTML = body; document.body.appendChild(dv); setTimeout(function () { eaddr.init(); }, 1000); }); }(); //usage: Test

this is another web page