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

enable Javascript in iOS, support abort loading specific URLs #292

Merged
merged 7 commits into from Mar 28, 2019

Conversation

hnvn
Copy link
Member

@hnvn hnvn commented Jan 8, 2019

I create this pull request to give WebView few features:

  • enable Javascript in iOS.
  • support abort loading specific URLs by using regex pattern. Native webview in Android and iOS will use this regex to determine to continue or abort loading an URL in method shouldOverrideUrlLoading in Android and webView:decidePolicyForNavigationAction:decisionHandler in iOS

@sameerbakre
Copy link

Looks to be perfect answer to most of the problem we are having with this plugin.
When can we expect this to be available for downloading?

Copy link
Collaborator

@charafau charafau left a comment

Choose a reason for hiding this comment

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

enabling Javascript in iOS works as expected but for some reason it doesn't block URL redirection - at least when I click on twitter logo on flutter website, it gets redirected. Tested on iOS simulator

example/lib/main.dart Show resolved Hide resolved
@charafau charafau merged commit 8f1ad40 into fluttercommunity:master Mar 28, 2019
@evelyne24
Copy link

enabling Javascript in iOS works as expected but for some reason it doesn't block URL redirection - at least when I click on twitter logo on flutter website, it gets redirected. Tested on iOS simulator

The invalidUrlRegex doesn't appear to work with the WebviewScaffold?

@hnvn
Copy link
Member Author

hnvn commented Apr 30, 2019

Have a look at: #292 (comment)

@Raggaer
Copy link

Raggaer commented May 3, 2019

How should I stop the loading tho? using invalidUrlRegex on the Scaffold works fine (blocks the redirect) but I want to detect the url and fire my own event, is that possible?

onUrlChanged only fires when the website is fully loaded.

Thanks

@yorickreum
Copy link

@Raggaer Did you solve this problem? Facing the same issue…

@Raggaer
Copy link

Raggaer commented Nov 19, 2019

@yorickreum I could not solve this sadly. Hopefully someone has some information to share with us

@yorickreum
Copy link

My approach today was to listen to the state change (load abort event). This kind of works, it only gets fired twice (not once), that's quite annoying...

@yorickreum
Copy link

Still no solution...

@sameerbakre
Copy link

sameerbakre commented Jan 6, 2020

@yorickreum , yes, please use onStateChanged method available, you can use state.type == WebViewState.shouldStart to listen it for once only.

Please see this.

#43 (comment)

charafau added a commit that referenced this pull request Apr 7, 2020
enable Javascript in iOS, support abort loading specific URLs
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

Successfully merging this pull request may close these issues.

None yet

6 participants