How to get the url of the newly opened tab using Javascript?

﹥>﹥吖頭↗ 提交于 2020-06-16 17:30:27

问题


I am trying to open a new tab using JavaScript and then I want to get the url of the newly opened tab. I did some research and figured out it is something related to parent (current tab) and child (newly opened) tab communication.

I am able to open the new tab using the script:

 url='https://www.google.com/'+home;
 window.open(url, '_blank');

I want to get the url of my newly opened tab here in this script as you can see i have opened /home so it change the new url to https://store.google.com/magazine/compare_nest_speakers_displays?srp=/product/google_home. I want to get that new url in my script.

来源:https://stackoverflow.com/questions/62235024/how-to-get-the-url-of-the-newly-opened-tab-using-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!