1

I'm trying to open tickets (some modules in my application) in a new tab. While on the same window with the current instance of the opened tab, multiple tickets simply get populated inside the new tab with the focus on that opened tab. But when a new tab is opened in the parent and a new ticket is opened from that particular tab, it doesn't populate in the existing tab but it opens a new tab. So basically I want some logic to identify whether a ticket tab is opened anywhere from the system so that when a new ticket is opened anywhere from the system, it should simply get render in the existing opened tab.

I have used local storage and wish I can save the window.open object to the local storage. ut that simply can't possible as while JSON.stringify it gives an error of TypeError: Converting circular structure to JSON

  var getWindowFromLocal = localStorage.getItem("windowOpened");
  if(getWindowFromLocal != "" && getWindowFromLocal != null)
  {
    //alreadyOpenedWindow.push(getWindowFromLocal);
    if(alreadyOpenedWindow.indexOf(config.url) == -1)
    {

      // obj[config.url] = 
      alreadyOpenedWindow.push(config.url);
      localStorage.setItem("windowOpened", alreadyOpenedWindow);
      newWindow = window;
    }
    else
    {
      newWindow = window;
    }

  }
  else{

    alreadyOpenedWindow.push(config.url)

    localStorage.setItem("windowOpened", alreadyOpenedWindow);
    newWindow = window.open(config.url, config.name, config.options);
  }```
shaurya
  • 581
  • 1
  • 4
  • 8
  • https://stackoverflow.com/questions/23690666/check-if-my-website-is-open-in-another-tab/43291970 this might give you a clue – Akhil Aravind Aug 13 '19 at 11:18

0 Answers0