Run code in a frame from one site to another with JavaScript
Advertisements I have Site A and Site B. Site B is hosted on Site A in a frame. I can communicate between sites using this code: Code on site A: const frame = document.getElementById(‘frame’); frame.contentWindow.postMessage(‘Hello’, ‘https://www.test.com’); Code on site B: window.addEventListener(‘message’, event => { console.log(event.data); }); This code is intended to forward the message. Can… Read More Run code in a frame from one site to another with JavaScript