File size: 1,211 Bytes
782bb59 c91e80e 5e2a3f3 53f6048 9a82139 5e2a3f3 9a82139 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modify Iframe Content</title>
</head>
<body>
<iframe
id="myIframe"
src="https://oldfart-pixl.hf.space"
frameborder="0"
width="850"
height="450"
onload="removeTextFromIframe();"
></iframe>
<script>
function removeTextFromIframe() {
// Get the iframe element
var iframe = document.getElementById('myIframe');
// Check if the content inside the iframe is from the same origin
if (iframe.contentDocument) {
// Access the document inside the iframe
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
// Modify the content as needed
var textToRemove = "nerijs/pixel-art-xl";
var iframeContent = iframeDoc.body.innerHTML;
var modifiedContent = iframeContent.replace(new RegExp(textToRemove, 'g'), '');
// Update the content inside the iframe
iframeDoc.body.innerHTML = modifiedContent;
} else {
console.error('Cannot access content inside the iframe due to cross-origin restrictions.');
}
}
</script>
</body>
</html>
|