-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: launch_url fails with pop-up blocker on safari #1105
Comments
A webbiew would solve this issue as the link could be put into a webview and be acted on within the browser. |
Just from testing flutils link to docs on iPhone Safari and had thesame issue. (No new tab with the expected link) |
The only way to fix this is to get the link click action in safari itself and not incur a roundtrip to the server. |
I've been thinking a lot about this issue. It's no-go of cause... How about we add a new |
I think that may work, not sure of the timing requirement here. Any lag in the communications would cause this to fail. A work around is to have an HTML Control and let us put a One thing to think about here is links in Markdown as well, the round trip on safari means we can't open a new tab |
If there was a way to have the link work 100% locally on the browser, it would work every time. |
Markdown is not a problem as we could add something like |
I've made a small prototype with import flet as ft
def main(page: ft.Page):
page.add(
ft.ElevatedButton(
"Open with CLICK",
on_click=lambda e: e.page.launch_url("https://google.com"),
),
ft.ElevatedButton("Open with URL", url="https://google.com"),
)
ft.app(target=main, view=ft.WEB_BROWSER) Clicking "Open with URL" button on Safari successfully opens a new tab with 100% reliability while, as expected, clicking "Open with CLICK" gives a blocked popup. I'm going ahead and add
New properties added to
|
The solution could be tried with Flet pre-release. |
using launch_url with web_window_name of
"_blank"
fails on safari due to too much delay (as per flutter/flutter#78524)I have done all I can to reduce the delay, but the time it takes for a button click to go from the browser to the server and back is enough to stop Safari from opening the new tab.
Code example to reproduce the issue:
I expected a new tab to open but instead get a message about a blocked pop up
Does not occur on firefox
Name: flet
Version: 0.4.2
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author: Appveyor Systems Inc.
Author-email: [email protected]
License: Apache-2.0
Location: /Users/gregor.brandt/Documents/Startbridge/web-app2/fe_env/lib/python3.11/site-packages
Requires: flet-core, httpx, oauthlib, packaging, watchdog, websocket-client, websockets
Required-by:
The text was updated successfully, but these errors were encountered: