UPDATED: as @papegaaij mentioned, the workaround to use webRequest.onBeforeRedirect does not work anymore in MV3. Anyway, you can use tabs.onUpdated instead. tabs.onUpdated provides changeInfo object where you can observe a url being redirected to.
browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (changeInfo.url && changeInfo.url === 'your-reachable-redirect-url') {
// do your post sign-in ceremony
// e.g. take authCode from the query param, etc.
}
})
Topic:
Safari & Web
SubTopic:
General
Tags: