Spyke
Yorureply
lemmy.world

hmm, interesting. It works when I do it in my node environment, but the moment the browser tries to make the request it fails.

3
Yorureply
lemmy.world

oh, it's because lemmy.world doesn't allow api requests from lemmy.ml, and vice-versa. Is it possible that there's a workaround?

1
Yorureply
lemmy.world

I'm making a bookmarklet to transfer followed communities from one instance to another

1
ericjmoreyreply
lemmy.world

Whoever would be using that bookmarklet would need to have accounts on both instances.

1

that's not the issue unfortunately, websites usually don't allow api requests to be made from another website, I fixed it using this github repo

1
nickelreply
lemmy.world

@[email protected] - it has to do with CORS (says in the error message) - You generally can't make cross-origin requests in the browser unless it is explicitly allowed. This is purely a browser limitation, which is why it works in your node environment. But if you open the console on any random website and try to call fetch() to that API, it's going to fail on any site other than lemmy.world.

5
Yorureply
lemmy.world

yeah that's what I observed after a few more trying, is there a possible workaround to this?

2

Anything you do cross-origin will have to be done in a server-like environment instead of in the browser.

3

You reached the end