Commit 794f8ec0 authored by Pascal's avatar Pascal
Browse files

fix remove inner buttons

parent 9fd33fcf
...@@ -5,13 +5,16 @@ ...@@ -5,13 +5,16 @@
</div> </div>
{# FIXME: try to remove buttons inside preview iframe... #} {# FIXME: try to remove buttons inside preview iframe... #}
<script> <script>
document.querySelector("iframe").addEventListener( "load", function(e) { /* https://stackoverflow.com/questions/326069 */
return; function inIframe () {
var iframe = document.querySelector("iframe"); try {
var inner = iframe.contentDocument || iframe.contentWindow.document; return window.self !== window.top;
var divs = inner.getElementsByClassName('auth-button-div'); } catch (e) {
return true;
}
}
if (inIframe()) {
var divs = document.getElementsByClassName('auth-button-div');
if (divs) divs[0].parentNode.removeChild(divs[0]); if (divs) divs[0].parentNode.removeChild(divs[0]);
//var divs = inner.getElementsByClassName('auth-flashes'); }
//if (divs) divs[0].parentNode.removeChild(divs[0]);
});
</script> </script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment