function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
maf1794maf1794 

Open link in same window using force:navigateToURL

Hello,

When using force:navigateToURL to redirect to an external address it opens in a new tab. How can I replace the current window with the new URL?

​Thanks.
Best Answer chosen by maf1794
Ashif KhanAshif Khan
Hi maf1794,

For external address try.
 
window.open('www.youraddress.com','_top')

Let me know, Is it work?.

All Answers

Ashif KhanAshif Khan
Hi maf1794,

For external address try.
 
window.open('www.youraddress.com','_top')

Let me know, Is it work?.
This was selected as the best answer
Mahmoud AbdelsalamMahmoud Abdelsalam
you can also use  
window.location.href
If you need to open it at the same window 
Nishant Dubey 7Nishant Dubey 7
Thanks Ashif for solution. It work perfectly fine