I'm working on a developing a browser extension which uses StackExchange API authentication. I was able to successfully implement the authentication for Microsoft edge/Chrome when I added chromiumapp.org as the OAuth Domain in the app settings & redirecturi = browser.identity.getRedirectURL('oauth2') as mentioned here.
But this doesn't work with Firefox since the domain chromiumapp.org is specific to chromium browsers. The domain for Firefox is allizom.org. And its not possible to add multiple domains to the StackApp in app settings.
So as suggested in the questions here & here, I tried adding
stackexchange.comas theOAuth Domainin app settings &redirect_uri = https://stackexchange.com/oauth/login_success, but this create another issue (similar to this & this),where, when the user clicks the login button, a new window is opened for the authorization which lets the user login to stack overflow. And once the login is successful, the window should automatically close. But the window gets redirected to the
https://stackexchange.com/oauth/login_successwhich is theredirect_uriand gets stuck there. (below screenshot)I tried the same in a new instance of a browser which lets me login to using Google/GitHub OAuth, but even that returns to the same page an gets stuck there.
I'm also wondering if using the domain
chromiumapp.orgorallizom.orgis secure at all! As mentioned in this answer, it sounds like a security concern.
Can anyone please help with solving this issue?

chromiumapp.orgorallizom.orgis secure at all! As mentioned in this answer, it sounds like a security concern.