Skip to content

Instantly share code, notes, and snippets.

@clochix
Created July 29, 2013 13:12
Show Gist options
  • Save clochix/6104201 to your computer and use it in GitHub Desktop.
Save clochix/6104201 to your computer and use it in GitHub Desktop.
Helper for frames navigation with Firebug
var frame = {
_names: {},
list: function () {
var self = this;
[].forEach.call(document.querySelectorAll('frame, iframe'), function (e) {
self._names[e.name] = e.contentWindow;
console.log(e.name);
});
},
cd: function (name) {
if (!this._names[name]) {
this.list();
}
if (!this._names[name]) {
console.log("Unknown frame");
} else {
cd(this._names[name]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment