res = await fetch("https://replit_account.repl.co/hello");
But this does not seem to work. Is there anything i need to do or configure on the server side to allow for requests from a chrome extension ? The server itself works when using a a browser.
Make sure your fetching the right link, it should be https://<repl name>.<username>.repl.co/hello. If you could post a link to your server that might help the community help with your issue.
I could be wrong, but it sounds like you are a victim of a CORS error. This is a system implemented by browsers to prevent sites from stealing a user’s data on other sites.
You’ve got two main options:
Add your Repl’s origin to the host_permissions key in your manifest. This tells Chrome to bypass CORS for requests from your extension’s service worker.
Hey there! are you making a chrome replit extension that posts some data to a server?
Well, you can’t do that. Why? because the request are blocked by CORS for some security reasons.
Replit will only allow you to fetch to a replit.com domain.