@mallory_cormier
One way to detect when iframe scripts are are executed is by using the "postMessage" API. This API allows communication between the parent window and the iframe, so you can listen for messages sent from the iframe when a script is executed.
Here is an example of how you can use the postMessage API to detect when iframe scripts are executed:
1 2 3 4 5 |
window.addEventListener('message', function(event) { if (event.data === 'iframeScriptExecuted') { console.log('Iframe script executed'); } }); |
1 2 3 |
window.addEventListener('load', function() { parent.postMessage('iframeScriptExecuted', '*'); }); |
By using this method, you can detect when iframe scripts are executed and take any necessary actions based on that information.