Shared publicly  - 
 
#DevTools Tip: Store JavaScript objects as temporary global variables

Paused at a breakpoint? Store a locally scoped JavaScript object as a global variable by right clicking on it in the Console panel and selecting Store as global variable
137
175
Jan Killian's profile photoTarek Faham's profile photoDiego Lameira's profile photoЕвгений Козлов's profile photo
9 comments
 
If you don't know how this is useful, well, move along. :)
 
+Paul Irish  So this will persist the object beyond the debugging session (instead of having to log as JSON) and it will stick around as long as that tab does? OR, is there other significance here?
 
This could be useful if you're trying to debug a variable within a deep-nested scope without modifying the source. I'd much rather have Chrome's console.log not update objects after they've been written to the console though.
 
Sweet, now we don't have to type "window.temp4 = that.view" anymore !
 
in angular you can also access services and their data properties from console easily:
x = angular.element(document).injector().get('$rootScope')
 
Interesting, but I prefer to write "window.temp4 = taht.view". Mouse cursor usually takes longer than write with keyboard, since you're already with 2 hands on it.
 
currently it does not work at JSON preview(Network tab) :(
returns undefined and global var just created equals undefined

alongside it could be very helpful especially while debugging data recieved
Add a comment...