Re: onInstalled listener

90 views
Skip to first unread message

Nafees Nehar

unread,
Jun 24, 2024, 9:46:30 AMJun 24
to Chromium Extensions
Isn't the attached code supposed to fire only when the extension is updated in the background?

```
const handleExtensionInstalledOrUpdated = (details: chrome.runtime.InstalledDetails) => {
  if (details.reason === chrome.runtime.OnInstalledReason.INSTALL) {
    chrome.tabs.create({ url: config.WEB_URL + "/extension-installed" });
  }

  if (details.reason === chrome.runtime.OnInstalledReason.UPDATE) {
    chrome.tabs.create({ url: config.WEB_URL + "/extension-updated" });
  }
};

export const handleInstall = () => {
  chrome.runtime.onInstalled.addListener(handleExtensionInstalledOrUpdated);
};
```

Some customers have reported that the `extension-updated` page is being opened on every browser restart. Is there something wrong?

Thanks. 
Screenshot 2024-06-24 at 7.08.59 PM.png

lucky bgm

unread,
Jun 24, 2024, 10:35:44 AMJun 24
to nafe...@gmail.com, chromium-...@chromium.org

Thsnks


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/749c23f4-d160-41d9-91ca-c8e898f3894cn%40chromium.org.
Reply all
Reply to author
Forward
0 new messages