Skip to content

bug: WebView Cross-Origin-Embedder-Policy (COEP) header error #6316

@webmedik

Description

@webmedik

Duplicate Check

Describe the bug

Using the example https://docs.flet.dev/webview/
running: uv run flet run --web .\main.py
server: http://127.0.0.1:63348

Firefox 148.0.2 (64-bit) response:

"""
Be careful. Something doesn’t look right.

Firefox didn’t load this page because it looks like the security configuration doesn’t match the previous page.

Sometimes websites set up protections for themselves and people like you from unwanted interactions with other sites.
Learn more about Cross Origin Embedder Policies (COEP)
"""

Injecting <script> tag. Using callback. entrypoint_loader.js:126:17
unreachable code after return statement main.dart.js:211575:1
unreachable code after return statement main.dart.js:229177:1
WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER. canvaskit.js:15:383
Flutter app loaded 127.0.0.1:63348:44:15
WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER. 2 canvaskit.js:15:383
WebGL warning: getParameter: The READ_BUFFER attachment is multisampled. 2

Chrome 146.0.7680.80 (Official Build) (64-bit) response:

"""
flet.dev refused to connect.

"""

Flutter app loaded
(index):1 Unsafe attempt to load URL https://flet.dev/ from frame with URL chrome-error://chromewebdata/. Domains, protocols and ports must match.
Understand this error

Code sample

Code
import flet_webview as fwv

import flet as ft


def main(page: ft.Page):
    page.add(
        fwv.WebView(
            url="https://flet.dev",
            on_page_started=lambda _: print("Page started"),
            on_page_ended=lambda _: print("Page ended"),
            on_web_resource_error=lambda e: print("WebView error:", e.data),
            expand=True,
        )
    )


ft.run(main)

To reproduce

uv run flet run --web .\main.py

Expected behavior

return and show https://flet.dev

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

10

Flet version

0.82.2

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions