Javascript view all page variable in console

April 5, 2017

If you want to see all the javascript variables set in the page via the console you can use the following function.


<pre class="brush: javascript; gutter: false">function showNonNatives ()


   var _arrHits = []

   for(var b in window)





           try{_arrHits.push(b + &quot; = &quot; + window[b]);}catch(e){};



   return _arrHits;



Here is a screenshot of how to run the function in the console




If you have any suggestions on how to improve this please contact us. 

Share on Facebook
Share on Twitter
Please reload

Recent Posts
Please reload

Please reload

Search By Tags
Please reload

Please reload

Certified Development

We design, build, develop, manage, advise and host Laravel and Magento

Ecomus logo

London, Brighton and the UK

©2008 - 2020 Ecomus Ltd.  All Rights Reserved