Created
April 1, 2021 08:44
-
-
Save YazeedAlKhalaf/9aec562f499b208f3f1023ca97f85e01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
let toInsertDiv = document.createElement("div"); | |
let toInsertObject = document.createElement("object"); | |
let toInsertIframe = document.createElement("iframe"); | |
let pdfSrcUrl = prompt("Please enter the PDF source url"); | |
if (pdfSrcUrl == null) return; | |
let height = "787px"; | |
let width = "600px"; | |
toInsertObject.width = width; | |
toInsertObject.height = height; | |
toInsertIframe.width = width; | |
toInsertIframe.height = height; | |
toInsertIframe.src = pdfSrcUrl; | |
toInsertDiv.appendChild(toInsertObject); | |
toInsertObject.appendChild(toInsertIframe); | |
document | |
.getElementById("edit-comment-body_ifr") | |
.contentDocument.getElementById("tinymce") | |
.appendChild(toInsertDiv); | |
alert( | |
"Have Fun 🙈!" | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment