<!DOCTYPE html>
<html lang="en">
<head>
<!-- Load from jsDelivr -->
<script src="https://cdn.jsdelivr.net/gh/ashishagarwal2023/[email protected]/src/freegpt.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My demo page</title>
</head>
<body>
<script>
(async () => {
let response = await gpt.ask("Explain variables in javascript");
console.log(response); // you got it!
})();
</script>
</body>
</html>
on my local pc chrome browser, but that did not work and got this javascript errors:
Access to fetch at 'https://you.com/api/streamingSearch?q=Explain%20variables%20in%20javascript&page=1&count=10&domain=youchat' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
freegpt.js:10
GET https://you.com/api/streamingSearch?q=Explain%20variables%20in%20javascript&page=1&count=10&domain=youchat net::ERR_FAILED 403 (Forbidden)
(anonymous) @ freegpt.js:10
ask @ freegpt.js:68
(anonymous) @ testGPT.html:13
(anonymous) @ testGPT.html:15
freegpt.js:15 Bot failed to fetch response: TypeError: Failed to fetch
at freegpt.js:10:30
at Object.ask (freegpt.js:68:18)
at testGPT.html:13:28
at testGPT.html:15:3
I think this is related to cloudflare protection. even with javascript client it still not working, is there anyway to bypass it?