Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[webview_flutter] iOS now can open iframe links and target _blank links - #2067

Closed
rodruiz wants to merge 15 commits into
flutter-team-archive:masterfrom
rodruiz:master
Closed

[webview_flutter] iOS now can open iframe links and target _blank links#2067
rodruiz wants to merge 15 commits into
flutter-team-archive:masterfrom
rodruiz:master

Conversation

@rodruiz

@rodruiz rodruiz commented Sep 16, 2019

Copy link
Copy Markdown

Description

iOS will be able to open iframe links, ads and target _blank links.

Related Issues

Fix issue 28875.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • [x ] All existing and new tests are passing.
  • [x ] I updated/added relevant documentation (doc comments with ///).
  • [x ] The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • [x ] The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • [x ] No, this is not a breaking change.

@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@rodruiz

rodruiz commented Sep 23, 2019

Copy link
Copy Markdown
Author

Hi,
the solution is to cancel the navigation and load the request with loadRequest: again. This will be come the similar behavior like UIWebView which always open new window in the current frame.
To have an implementation of WKUIDelegate and set it to _webview.UIDelegate.
For more info see stackoverflow.
Thanks.

@rodruiz

rodruiz commented Sep 24, 2019

Copy link
Copy Markdown
Author

@googlebot I fixed it.

@rodruiz
rodruiz requested a review from amirh as a code owner October 7, 2019 18:37
@rodruiz

rodruiz commented Oct 22, 2019

Copy link
Copy Markdown
Author

Hi @amirh, could you review this PR?
Thanks!

@rodruiz

rodruiz commented Nov 22, 2019

Copy link
Copy Markdown
Author

Hi @amirh, any plans to review this PR?
Thanks!

@rodruiz

rodruiz commented Dec 12, 2019

Copy link
Copy Markdown
Author

Hi @amirh, could you review this PR please?
Thanks!

@rodruiz

rodruiz commented Jan 27, 2020

Copy link
Copy Markdown
Author

Hi @amirh, could you review this PR please?
Thanks!

@amirh amirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

We'd need to test opening a _blank link before this can land, I we can add an e2e test case to cover it here: https://github.com/flutter/plugins/blob/master/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart

webView.getSettings().setDomStorageEnabled(true);

// Allow zoom and hide the zoom in and zoom out buttons.
webView.getSettings().setSupportZoom(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this setting be controllable by the app developer? any I'd suggest splitting these 2 features to separate PRs

name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
version: 0.3.19+5
version: 0.3.19+6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether we should consider this a breaking change (as it will break any app relying on these links not being opened)

@amirh

amirh commented Feb 6, 2020

Copy link
Copy Markdown
Contributor

Closing in favor of #2500

@amirh amirh closed this Feb 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants