Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Flutter Inappwebview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
Flutter Inappwebview
Commits
57e1a86b
Commit
57e1a86b
authored
6 years ago
by
pichillilorenzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed loading error handling for android and iOS
parent
eabcb030
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
42 deletions
+67
-42
.idea/workspace.xml
.idea/workspace.xml
+48
-22
README.md
README.md
+2
-2
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserWebViewClient.java
...renzo/flutter_inappbrowser/InAppBrowserWebViewClient.java
+2
-3
example/lib/main.dart
example/lib/main.dart
+2
-2
ios/Classes/InAppBrowserWebViewController.swift
ios/Classes/InAppBrowserWebViewController.swift
+10
-10
ios/Classes/SwiftFlutterPlugin.swift
ios/Classes/SwiftFlutterPlugin.swift
+1
-1
lib/flutter_inappbrowser.dart
lib/flutter_inappbrowser.dart
+2
-2
No files found.
.idea/workspace.xml
View file @
57e1a86b
...
@@ -11,9 +11,12 @@
...
@@ -11,9 +11,12 @@
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"9b41f7a2-a71e-4923-91fb-249d7815b3e7"
name=
"Default"
comment=
""
>
<list
default=
"true"
id=
"9b41f7a2-a71e-4923-91fb-249d7815b3e7"
name=
"Default"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
beforePath=
"$PROJECT_DIR$/
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java
"
/>
<change
beforePath=
"$PROJECT_DIR$/
README.md"
afterPath=
"$PROJECT_DIR$/README.md
"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserWebViewClient.java"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserWebViewClient.java"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserWebViewClient.java"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserWebViewClient.java"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/main.dart"
afterPath=
"$PROJECT_DIR$/example/lib/main.dart"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/InAppBrowserWebViewController.swift"
afterPath=
"$PROJECT_DIR$/ios/Classes/InAppBrowserWebViewController.swift"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/InAppBrowserWebViewController.swift"
afterPath=
"$PROJECT_DIR$/ios/Classes/InAppBrowserWebViewController.swift"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/SwiftFlutterPlugin.swift"
afterPath=
"$PROJECT_DIR$/ios/Classes/SwiftFlutterPlugin.swift"
/>
<change
beforePath=
"$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
afterPath=
"$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
/>
</list>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
...
@@ -33,8 +36,8 @@
...
@@ -33,8 +36,8 @@
<file
leaf-file-name=
"flutter_inappbrowser.dart"
pinned=
"false"
current-in-tab=
"false"
>
<file
leaf-file-name=
"flutter_inappbrowser.dart"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
513
"
>
<state
relative-caret-position=
"
270
"
>
<caret
line=
"
198"
column=
"52"
lean-forward=
"false"
selection-start-line=
"198"
selection-start-column=
"52"
selection-end-line=
"198"
selection-end-column=
"52
"
/>
<caret
line=
"
37"
column=
"27"
lean-forward=
"false"
selection-start-line=
"37"
selection-start-column=
"27"
selection-end-line=
"37"
selection-end-column=
"27
"
/>
<folding>
<folding>
<element
signature=
"e#814#834#0"
expanded=
"true"
/>
<element
signature=
"e#814#834#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -45,8 +48,8 @@
...
@@ -45,8 +48,8 @@
<file
leaf-file-name=
"main.dart"
pinned=
"false"
current-in-tab=
"true"
>
<file
leaf-file-name=
"main.dart"
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
141
"
>
<state
relative-caret-position=
"
243
"
>
<caret
line=
"2
5"
column=
"21"
lean-forward=
"false"
selection-start-line=
"25"
selection-start-column=
"21"
selection-end-line=
"25"
selection-end-column=
"21
"
/>
<caret
line=
"2
0"
column=
"19"
lean-forward=
"true"
selection-start-line=
"20"
selection-start-column=
"19"
selection-end-line=
"20"
selection-end-column=
"19
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
...
@@ -128,13 +131,13 @@
...
@@ -128,13 +131,13 @@
<option
value=
"$PROJECT_DIR$/LICENSE"
/>
<option
value=
"$PROJECT_DIR$/LICENSE"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserDialog.java"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserDialog.java"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserClient.java"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserClient.java"
/>
<option
value=
"$PROJECT_DIR$/README.md"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowser.java"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowser.java"
/>
<option
value=
"$PROJECT_DIR$/example/ios/Podfile"
/>
<option
value=
"$PROJECT_DIR$/example/ios/Podfile"
/>
<option
value=
"$PROJECT_DIR$/ios/flutter_inappbrowser.podspec"
/>
<option
value=
"$PROJECT_DIR$/ios/flutter_inappbrowser.podspec"
/>
<option
value=
"$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
/>
<option
value=
"$PROJECT_DIR$/android/build.gradle"
/>
<option
value=
"$PROJECT_DIR$/android/build.gradle"
/>
<option
value=
"$PROJECT_DIR$/pubspec.yaml"
/>
<option
value=
"$PROJECT_DIR$/pubspec.yaml"
/>
<option
value=
"$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
/>
<option
value=
"$PROJECT_DIR$/README.md"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
</list>
</list>
</option>
</option>
...
@@ -419,6 +422,7 @@
...
@@ -419,6 +422,7 @@
</component>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"288"
y=
"23"
width=
"1632"
height=
"1057"
extended-state=
"0"
/>
<frame
x=
"288"
y=
"23"
width=
"1632"
height=
"1057"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<layout>
<layout>
<window_info
id=
"Android Profiler"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Android Profiler"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Build Variants"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Build Variants"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
...
@@ -436,7 +440,7 @@
...
@@ -436,7 +440,7 @@
<window_info
id=
"Palette	"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Palette	"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Image Layers"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Image Layers"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Analysis"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Analysis"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"
tru
e"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.36208734"
sideWeight=
"0.4973545"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"
fals
e"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.36208734"
sideWeight=
"0.4973545"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"9"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"9"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.3258786"
sideWeight=
"0.4973545"
order=
"10"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.3258786"
sideWeight=
"0.4973545"
order=
"10"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Captures"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32936507"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Captures"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32936507"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
...
@@ -696,16 +700,6 @@
...
@@ -696,16 +700,6 @@
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserClient.java"
/>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserClient.java"
/>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserDialog.java"
/>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserDialog.java"
/>
<entry
file=
"file://$PROJECT_DIR$/README.md"
>
<provider
selected=
"true"
editor-type-id=
"split-provider[text-editor;markdown-preview-editor]"
>
<state
split_layout=
"SPLIT"
>
<first_editor
relative-caret-position=
"106"
>
<caret
line=
"94"
column=
"0"
lean-forward=
"true"
selection-start-line=
"94"
selection-start-column=
"0"
selection-end-line=
"94"
selection-end-column=
"0"
/>
</first_editor>
<second_editor
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/ios/Flutter/Release.xcconfig"
>
<entry
file=
"file://$PROJECT_DIR$/example/ios/Flutter/Release.xcconfig"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<state
relative-caret-position=
"0"
>
...
@@ -832,10 +826,42 @@
...
@@ -832,10 +826,42 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/README.md"
>
<provider
selected=
"true"
editor-type-id=
"split-provider[text-editor;markdown-preview-editor]"
>
<state
split_layout=
"SPLIT"
>
<first_editor
relative-caret-position=
"416"
>
<caret
line=
"41"
column=
"11"
lean-forward=
"true"
selection-start-line=
"41"
selection-start-column=
"11"
selection-end-line=
"41"
selection-end-column=
"11"
/>
<folding>
<marker
date=
"1537620468637"
expanded=
"false"
signature=
"933:1031"
ph=
"..."
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1075:1571"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1121:1189"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1233:1300"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1371:1475"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1505:1568"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1698:1763"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1804:2315"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1838:1866"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1917:2313"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1945:2308"
ph=
"(...)"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1971:2301"
ph=
"(...)"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"1999:2082"
ph=
"(...)"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"2028:2071"
ph=
"(...)"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"2108:2292"
ph=
"(...)"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"2143:2281"
ph=
"(...)"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"10474:10507"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"10626:10658"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"10818:10850"
ph=
"{...}"
/>
<marker
date=
"1537620468637"
expanded=
"true"
signature=
"10946:10971"
ph=
"{...}"
/>
</folding>
</first_editor>
<second_editor
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
513
"
>
<state
relative-caret-position=
"
270
"
>
<caret
line=
"
198"
column=
"52"
lean-forward=
"false"
selection-start-line=
"198"
selection-start-column=
"52"
selection-end-line=
"198"
selection-end-column=
"52
"
/>
<caret
line=
"
37"
column=
"27"
lean-forward=
"false"
selection-start-line=
"37"
selection-start-column=
"27"
selection-end-line=
"37"
selection-end-column=
"27
"
/>
<folding>
<folding>
<element
signature=
"e#814#834#0"
expanded=
"true"
/>
<element
signature=
"e#814#834#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -844,8 +870,8 @@
...
@@ -844,8 +870,8 @@
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
141
"
>
<state
relative-caret-position=
"
243
"
>
<caret
line=
"2
5"
column=
"21"
lean-forward=
"false"
selection-start-line=
"25"
selection-start-column=
"21"
selection-end-line=
"25"
selection-end-column=
"21
"
/>
<caret
line=
"2
0"
column=
"19"
lean-forward=
"true"
selection-start-line=
"20"
selection-start-column=
"19"
selection-end-line=
"20"
selection-end-column=
"19
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
...
...
This diff is collapsed.
Click to expand it.
README.md
View file @
57e1a86b
...
@@ -40,8 +40,8 @@ class MyInAppBrowser extends InAppBrowser {
...
@@ -40,8 +40,8 @@ class MyInAppBrowser extends InAppBrowser {
}
}
@override
@override
void
onLoadError
(
String
url
,
String
code
,
String
message
)
{
void
onLoadError
(
String
url
,
int
code
,
String
message
)
{
super
.
onLoad
Stop
(
url
);
super
.
onLoad
Error
(
url
,
code
,
message
);
print
(
"
\n\n
Can't load
$url
.. Error:
$message
\n\n
"
);
print
(
"
\n\n
Can't load
$url
.. Error:
$message
\n\n
"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserWebViewClient.java
View file @
57e1a86b
...
@@ -149,8 +149,7 @@ public class InAppBrowserWebViewClient extends WebViewClient {
...
@@ -149,8 +149,7 @@ public class InAppBrowserWebViewClient extends WebViewClient {
Map
<
String
,
Object
>
obj
=
new
HashMap
<>();
Map
<
String
,
Object
>
obj
=
new
HashMap
<>();
obj
.
put
(
"url"
,
error
.
getUrl
());
obj
.
put
(
"url"
,
error
.
getUrl
());
obj
.
put
(
"code"
,
0
);
obj
.
put
(
"code"
,
error
.
getPrimaryError
());
obj
.
put
(
"sslerror"
,
error
.
getPrimaryError
());
String
message
;
String
message
;
switch
(
error
.
getPrimaryError
())
{
switch
(
error
.
getPrimaryError
())
{
case
SslError
.
SSL_DATE_INVALID
:
case
SslError
.
SSL_DATE_INVALID
:
...
@@ -173,7 +172,7 @@ public class InAppBrowserWebViewClient extends WebViewClient {
...
@@ -173,7 +172,7 @@ public class InAppBrowserWebViewClient extends WebViewClient {
message
=
"The certificate authority is not trusted"
;
message
=
"The certificate authority is not trusted"
;
break
;
break
;
}
}
obj
.
put
(
"message"
,
message
);
obj
.
put
(
"message"
,
"SslError: "
+
message
);
InAppBrowserFlutterPlugin
.
channel
.
invokeMethod
(
"loaderror"
,
obj
);
InAppBrowserFlutterPlugin
.
channel
.
invokeMethod
(
"loaderror"
,
obj
);
handler
.
cancel
();
handler
.
cancel
();
...
...
This diff is collapsed.
Click to expand it.
example/lib/main.dart
View file @
57e1a86b
...
@@ -43,8 +43,8 @@ class MyInAppBrowser extends InAppBrowser {
...
@@ -43,8 +43,8 @@ class MyInAppBrowser extends InAppBrowser {
}
}
@override
@override
void
onLoadError
(
String
url
,
String
code
,
String
message
)
{
void
onLoadError
(
String
url
,
int
code
,
String
message
)
{
super
.
onLoad
Stop
(
url
);
super
.
onLoad
Error
(
url
,
code
,
message
);
print
(
"
\n\n
Can't load
$url
.. Error:
$message
\n\n
"
);
print
(
"
\n\n
Can't load
$url
.. Error:
$message
\n\n
"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/InAppBrowserWebViewController.swift
View file @
57e1a86b
...
@@ -489,21 +489,21 @@ class InAppBrowserWebViewController: UIViewController, WKUIDelegate, WKNavigatio
...
@@ -489,21 +489,21 @@ class InAppBrowserWebViewController: UIViewController, WKUIDelegate, WKNavigatio
navigationDelegate
?
.
webViewDidFinishLoad
(
webView
)
navigationDelegate
?
.
webViewDidFinishLoad
(
webView
)
}
}
func
webView
(
_
webView
:
WKWebView
,
//
func webView(_ webView: WKWebView,
didFailProvisionalNavigation
navigation
:
WKNavigation
!
,
//
didFailProvisionalNavigation navigation: WKNavigation!,
withError
error
:
Error
)
{
//
withError error: Error) {
print
(
"webView:didFailProvisionalNavigationWithError -
\(
Int
(
error
.
_code
)
)
:
\(
error
.
localizedDescription
)
"
)
//
print("webView:didFailProvisionalNavigationWithError - \(Int(error._code)): \(error.localizedDescription)")
backButton
.
isEnabled
=
webView
.
canGoBack
//
backButton.isEnabled = webView.canGoBack
forwardButton
.
isEnabled
=
webView
.
canGoForward
//
forwardButton.isEnabled = webView.canGoForward
spinner
.
stopAnimating
()
//
spinner.stopAnimating()
navigationDelegate
?
.
webView
(
webView
,
didFailLoadWithError
:
error
)
//
navigationDelegate?.webView(webView, didFailLoadWithError: error)
}
//
}
func
webView
(
_
webView
:
WKWebView
,
didFail
navigation
:
WKNavigation
!
,
withError
error
:
Error
)
{
func
webView
(
_
webView
:
WKWebView
,
didFail
navigation
:
WKNavigation
!
,
withError
error
:
Error
)
{
print
(
"webView:didFailNavigationWithError -
\(
Int
(
error
.
_code
)
)
:
\(
error
.
localizedDescription
)
"
)
print
(
"webView:didFailNavigationWithError -
\(
Int
(
error
.
_code
)
)
:
\(
error
.
localizedDescription
)
"
)
backButton
.
isEnabled
=
webView
.
canGoBack
backButton
.
isEnabled
=
webView
.
canGoBack
forwardButton
.
isEnabled
=
webView
.
canGoForward
forwardButton
.
isEnabled
=
webView
.
canGoForward
spinner
.
stopAnimating
()
spinner
.
stopAnimating
()
navigationDelegate
?
.
webView
(
webView
,
didFailLoadWithE
rror
:
error
)
navigationDelegate
?
.
webView
DidFailLoadWithError
(
webView
,
e
rror
:
error
)
}
}
}
}
This diff is collapsed.
Click to expand it.
ios/Classes/SwiftFlutterPlugin.swift
View file @
57e1a86b
...
@@ -325,7 +325,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
...
@@ -325,7 +325,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
channel
.
invokeMethod
(
"loadstop"
,
arguments
:
[
"url"
:
url
])
channel
.
invokeMethod
(
"loadstop"
,
arguments
:
[
"url"
:
url
])
}
}
func
webView
(
_
webView
:
WKWebView
,
didFailLoadWithError
error
:
Error
)
{
func
webView
DidFailLoadWithError
(
_
webView
:
WKWebView
,
error
:
Error
)
{
let
url
:
String
=
webViewController
!.
currentURL
!.
absoluteString
let
url
:
String
=
webViewController
!.
currentURL
!.
absoluteString
let
arguments
=
[
"url"
:
url
,
"code"
:
error
.
_code
,
"message"
:
error
.
localizedDescription
]
as
[
String
:
Any
]
let
arguments
=
[
"url"
:
url
,
"code"
:
error
.
_code
,
"message"
:
error
.
localizedDescription
]
as
[
String
:
Any
]
channel
.
invokeMethod
(
"loaderror"
,
arguments
:
arguments
)
channel
.
invokeMethod
(
"loaderror"
,
arguments
:
arguments
)
...
...
This diff is collapsed.
Click to expand it.
lib/flutter_inappbrowser.dart
View file @
57e1a86b
...
@@ -44,7 +44,7 @@ class InAppBrowser {
...
@@ -44,7 +44,7 @@ class InAppBrowser {
break
;
break
;
case
"loaderror"
:
case
"loaderror"
:
String
url
=
call
.
arguments
[
"url"
];
String
url
=
call
.
arguments
[
"url"
];
String
code
=
call
.
arguments
[
"code"
];
int
code
=
call
.
arguments
[
"code"
];
String
message
=
call
.
arguments
[
"message"
];
String
message
=
call
.
arguments
[
"message"
];
onLoadError
(
url
,
code
,
message
);
onLoadError
(
url
,
code
,
message
);
break
;
break
;
...
@@ -212,7 +212,7 @@ class InAppBrowser {
...
@@ -212,7 +212,7 @@ class InAppBrowser {
}
}
///Event fires when the [InAppBrowser] encounters an error loading an [url].
///Event fires when the [InAppBrowser] encounters an error loading an [url].
void
onLoadError
(
String
url
,
String
code
,
String
message
)
{
void
onLoadError
(
String
url
,
int
code
,
String
message
)
{
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment