I'm attempting to return the page title. Using document.title doesn't appear to be reliable. It's often returning the title of frames within a page and sometimes nothing depending on the web page. I'd like to return the title which appears at the top of the tab eg Gmail - Inbox etc..
on a Gmail page. Is there any alternatives to document.title? I'm testing on Chrome.
Sounds like the problem is with frames. You could try top.document.title
, which will give you the title of the topmost frame.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.