Skip to content

Instantly share code, notes, and snippets.

@yajd
Created March 10, 2014 23:16
Show Gist options
  • Select an option

  • Save yajd/9476471 to your computer and use it in GitHub Desktop.

Select an option

Save yajd/9476471 to your computer and use it in GitHub Desktop.
_ff-addon-snippet-DynamicallyInsertFrameIntoPanel - When you dyanically insert iframe into panel you MUST use namespace HTML or else on DOMContentLoaded or load(with true) the iframe.contentWindow will be undefined!!! Crazyyyyy
var iframe = win.document.createElementNS('http://www.w3.org/1999/xhtml', 'iframe');
iframe.setAttribute('style','border:0; background-color:rgba(255,255,255,.95); ;margin:0; padding:0; width:300px; height:300px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); border-radius:10px;');
iframe.addEventListener('DOMContentLoaded', function() {
console.log('done loaded', iframe.contentWindow);
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment