open muliple windows from chrome extension window in angular

above is the requirement. i have 3 tabs in my angular chrome extension. when right click on each tab it should open in a new window with alignment. below is my code for creating chrome extension. i struggling on this for past 2 weeks. I need some for opening only the tab’s content in the new window.

var isExtensionAlreadyOpened;
chrome.action.onClicked.addListener(async () => {
  chrome.windows.getCurrent((currentWindow) => {
    chrome.windows.update(currentWindow.id, {
      width: 900,
    });
  chrome.storage.local.get(["key"]).then((result) => {
    if(result.key!=undefined) isExtensionAlreadyOpened=result.key;
    let url = chrome.runtime.getURL("index.html");
    console.log(isExtensionAlreadyOpened);
    if(isExtensionAlreadyOpened==undefined){
      chrome.windows.create({
        url,
        type: "panel",
        width: 520,
        focused: true,
        left: 1000,
      });
      chrome.windows.getCurrent(data=>{
        chrome.storage.local.set({ key: data.id })
      })
    }
     else{
      chrome.windows.update(isExtensionAlreadyOpened, { focused: true })
     }
  });
});})
chrome.windows.onRemoved.addListener(data=>{
  chrome.storage.local.clear();
})


{
    "name": "DEV",
    "version": "1.1.6",
    "manifest_version": 3,
    "background": {
      "service_worker": "background.js"
    },
    "action": {
      "default_icon": "assets/fav.webp"
    },
    "permissions": [
      "storage",
      "notifications"
    ]
}

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.