Created
November 22, 2016 21:27
-
-
Save ndesmic/965e4bd6c39fc20b9fbc8879a591b454 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() { | |
var scripts = document.getElementsByTagName( 'script' ); | |
var thisScriptTag = scripts[ scripts.length - 1 ]; | |
for (var index = scripts.length - 1; index >= 0; index--) { | |
if (scripts[index].src.indexOf("iframe.js") > -1) { | |
thisScriptTag = scripts[index]; | |
break; | |
} | |
} | |
console.log(thisScriptTag); | |
var iframe = document.createElement('iframe'); | |
iframe.src = thisScriptTag.src.replace(/\.js/,'.html'); | |
iframe.src += '&docUrl='+encodeURIComponent(window.location.href); | |
iframe.frameBorder = 0; | |
iframe.setAttribute('webkitallowfullscreen', 'true'); | |
iframe.setAttribute('height', thisScriptTag.getAttribute('height') || "100%"); | |
iframe.setAttribute('width', thisScriptTag.getAttribute('width') || "100%"); | |
thisScriptTag.parentNode.insertBefore(iframe, thisScriptTag.nextSibling); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment