When you check the Gmail’s client source code. There is VIEW_DATA variable holds many stuff related to user’s data. Is it possible to access this data via Javascript?
When you check the Gmail’s client source code. There is VIEW_DATA variable holds many
Share
It looks like at some point after it’s used
VIEW_DATAis reset toundefined, perhaps to save memory. Gmail seems to keep almost everything neatly tucked away in closures which makes getting to it from the global context difficult.One possible—but fragile—approach would be to query the DOM for the
<script>element whereVIEW_DATAis defined, which would give you the original script, letting youeval()it in your own context. E.g.:Like I said, though, like any screen-scraping this is pretty fragile. If Google moves anything around you may find yourself suddenly eval-ing things you don’t want to, like function calls that will end up breaking the page. Use it at your own risk.
You may find find that ultimately other methods, like trying to find the data you’re looking for in the DOM instead, are more sensible.