Skip to main content

Hi im trying to implement the code on Figmas fetch to the console example but getting cors errors. I’ve added the domain to the list of allowed domains.


Fetch to the console
(async () => {
const response = await fetch('https://httpbin.org/get?success=true')
const json = await response.json()

console.log(JSON.stringify(json.args, null, 2))

figma.closePlugin()
})()
``` any ideas would be great.

How to add domain to allowed domains? I use “fetch” but getting “Refused to connect to ‘http://open.bigmodel.cn/api/paas/v4/chat/completions’ because it violates the following Content Security Policy directive: “default-src data: blob:”. Note that ‘connect-src’ was not explicitly set, so ‘default-src’ is used as a fallback.” in console


Reply