Skip to content
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

Detect and avoid navigate to other url on click #127

Open
MobileD3v3l opened this issue Jun 8, 2024 · 1 comment
Open

Detect and avoid navigate to other url on click #127

MobileD3v3l opened this issue Jun 8, 2024 · 1 comment

Comments

@MobileD3v3l
Copy link

MobileD3v3l commented Jun 8, 2024

Hi,

It's possible to detect clicks on links inside a website and block the navigation.

Something like:

shouldOverrideUrlLoading: (controller, url) async {
      if (url.startsWith('http://') || url.startsWith('https://')) {
          if (await canLaunch(url)) {
              await launch(url);
              return true; // Prevent navigation within WebView
          }
      }
      return false; // Allow navigation within WebView
},
@SinyimZhi
Copy link
Collaborator

It looks like you need a blacklist, and I will consider adding this feature next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants