Nattsurfaren
Power Member
- Apr 12, 2010
- 593
- 82
So I was trying to find a way to grab the email generated by temp-mail.org (not the api).
Usually the value in an input field is visible in the browser DOM inspector.
But for some reason they cleverly removed it.
I thought to myself that I wish I could find an overview of all nodes/objects. So that I could find where it is stored.
That would also help if I face this problem in other websites. I found this function to list the entire DOM.
What I got back was a huge object tree.
I wish I could just output everything to a string and search in a simple text editor.
But all attempt has been failing so far.
Any ideas how to deal with this?
Appreciate your help.
Usually the value in an input field is visible in the browser DOM inspector.
But for some reason they cleverly removed it.
I thought to myself that I wish I could find an overview of all nodes/objects. So that I could find where it is stored.
That would also help if I face this problem in other websites. I found this function to list the entire DOM.
Code:
var objs = []; // we'll store the object references in this array
function walkTheObject( obj ) {
var keys = Object.keys( obj ); // get all own property names of the object
keys.forEach( function ( key ) {
var value = obj[ key ]; // get property value
// if the property value is an object...
if ( value && typeof value === 'object' ) {
// if we don't have this reference...
if ( objs.indexOf( value ) < 0 ) {
objs.push( value ); // store the reference
walkTheObject( value ); // traverse all its own properties
}
}
});
}
walkTheObject( this ); // start with the global object
What I got back was a huge object tree.
I wish I could just output everything to a string and search in a simple text editor.
But all attempt has been failing so far.
Any ideas how to deal with this?
Appreciate your help.