Skip to content

Instantly share code, notes, and snippets.

Created January 3, 2013 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4442461 to your computer and use it in GitHub Desktop.
Save anonymous/4442461 to your computer and use it in GitHub Desktop.
// First, open the devtools (firefox nightly). Then execute this:
let iframe = document.getElementById("devtools-toolbox-bottom-iframe"); // we have an iframe
//... then we add a class to this node:
let CLASS_NAME = "foobar";
iframe.className = CLASS_NAME;
iframe.setAttribute("class", CLASS_NAME); // trying both ways
alert("why is this null: " + document.querySelector("." + CLASS_NAME));
alert("... and this is true: " + iframe.mozMatchesSelector("." + CLASS_NAME));
alert("... and this undefined: " + document.getElementsByClassName(CLASS_NAME)[0]);
@paulrouget
Copy link

Execute this code in a chrome scratchpad after opening the devtools (the web console for example).

I filed a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=826202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment