I have a page that receives a URL and opens it in a new browser tab.
window.open('someURL','myWindow').focus();
After that, the current page is closed.
window.open('','_self').close();
The next time my page loads, the received url opens in a new tab. How to make the received url open in an existing tab?
I cannot save the window object to localStorage, but maybe I can save the information about the tabs associated with it?
You can use local storage... The stored data is saved across browser sessions.
Set value:
localStorage.setItem('key', 'VALUE');
Retrive value:
const menu = localStorage.getItem('key');
If you want to remove keyValue pair:
localStorage.removeItem('key');