So for the Anki Connect integration for Mangatan on desktop https://github.com/KolbyML/Mangatan-WebUI/blob/2af90b378c2a5a1804f8489c8fa0d807830ea1e2/src/Mangatan/utils/anki.ts#L4-L45 this code works, if my request is denied, I can just request cors permissions, a popup will appear.
I don't want to tell my users to manually configure cors themselves, I want to be able to do a dialog from my end which triggers something on your end like how it works for AnkiConnect desktop