# Problem with CORS in WebView

**URL:** <https://community.folivora.ai/t/problem-with-cors-in-webview/47045>\
**Category:** Configuration Help & General Discussion\
**Tags:** floating-web-view, webview, floating-menu\
**Created:** [May 17, 2026, 7:20am UTC](https://community.folivora.ai/t/problem-with-cors-in-webview/47045 "2026-05-17T07:20:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MStankiewiczOfficial](https://community.folivora.ai/user_avatar/community.folivora.ai/mstankiewiczofficial/32/30271_2.png) [@MStankiewiczOfficial](https://community.folivora.ai/u/MStankiewiczOfficial)\
**Post date:** [May 17, 2026, 7:20am UTC](https://community.folivora.ai/t/problem-with-cors-in-webview/47045/1 "2026-05-17T07:20:08Z")

</div>

Hi!  
I want to create a floating menu with a WebView that uses AI. Unfortunately, OpenAI has a CORS block that prevents this, and an error appears in the console.

```log
Origin presetfile://ai_search.html is not allowed by Access-Control-Allow-Origin. Status code: 401

```

Does anyone have any idea how to bypass this?

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [May 17, 2026, 10:25am UTC](https://community.folivora.ai/t/problem-with-cors-in-webview/47045/2 "2026-05-17T10:25:34Z")

</div>

Could you post an example of a webview setup that can reproduce this?

---

<div class="post-metadata">

**Author:** ![MStankiewiczOfficial](https://community.folivora.ai/user_avatar/community.folivora.ai/mstankiewiczofficial/32/30271_2.png) [@MStankiewiczOfficial](https://community.folivora.ai/u/MStankiewiczOfficial)\
**Post date:** [May 17, 2026, 10:34am UTC](https://community.folivora.ai/t/problem-with-cors-in-webview/47045/3 "2026-05-17T10:34:02Z")

</div>

I have all the default settings in the newly created Floating Menu with WebView except for the link to this file.

[ai\_search.html](https://community.folivora.ai/uploads/short-url/cZldLRl5U3cZzvlu8IMsRKtv37d.html) (10.5 KB)

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [May 17, 2026, 10:38am UTC](https://community.folivora.ai/t/problem-with-cors-in-webview/47045/4 "2026-05-17T10:38:46Z")

</div>

I currently can't test but I think this is not a CORS block by OpenAI. Could you check whether it works if you enter the full HTML directly in the webview config instead of entering the presetfile path?

---

<div class="post-metadata">

**Author:** ![MStankiewiczOfficial](https://community.folivora.ai/user_avatar/community.folivora.ai/mstankiewiczofficial/32/30271_2.png) [@MStankiewiczOfficial](https://community.folivora.ai/u/MStankiewiczOfficial)\
**Post date:** [May 17, 2026, 11:03am UTC](https://community.folivora.ai/t/problem-with-cors-in-webview/47045/5 "2026-05-17T11:03:58Z")

</div>

Okay, I managed to solve the problem on my own. Indeed, I had an error in JavaScript, but I have already fixed it. Sorry
