Im trying to get this complete url:
https://mail.google.com/mail/u/0/?ui=2#inbox/13047asdee8be4e1
Through the use of:
var url = document.location.toString();
But it only returns up to https://mail.google.com/mail/u/0/?ui=2
I have also tried other ways like document.url, window.location and it still spits out same thing.
Try
window.location.href. Read this: window.location – MDCRun this in console to be sure.
Disclaimer:
This is the first time I am seeing all other answers wrong, except Jason 🙂So many good answers. Both describing how to go about solving it in a round about way and then showing the correct way as an afterthought 🙂