Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-tbs-webview
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenProject
cordova-plugin-tbs-webview
Commits
a1b5f1e9
Commit
a1b5f1e9
authored
Aug 17, 2019
by
mergen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对获取根activity的办法进行修改。
parent
82515606
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
platforms/android/src/org/apache/cordova/x5engine/X5WebViewClient.java
+6
-18
No files found.
platforms/android/src/org/apache/cordova/x5engine/X5WebViewClient.java
View file @
a1b5f1e9
/*
/*
Licensed to the Apache Software Foundation (ASF) under one
对系统等webview进行设置。。
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
1、增加了静态js加载mimetype的强制加入。
regarding copyright ownership. The ASF licenses this file
2、增加了img svg文件的mimetype的强制加入。(有bug)
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
*/
package
org
.
apache
.
cordova
.
x5engine
;
package
org
.
apache
.
cordova
.
x5engine
;
...
@@ -77,7 +66,6 @@ public class X5WebViewClient extends WebViewClient {
...
@@ -77,7 +66,6 @@ public class X5WebViewClient extends WebViewClient {
@Override
@Override
public
WebResourceResponse
shouldInterceptRequest
(
WebView
webView
,
WebResourceRequest
request
,
Bundle
bundle
)
{
public
WebResourceResponse
shouldInterceptRequest
(
WebView
webView
,
WebResourceRequest
request
,
Bundle
bundle
)
{
String
url
=
request
.
getUrl
().
toString
();
String
url
=
request
.
getUrl
().
toString
();
if
(
url
.
contains
(
".js"
)){
if
(
url
.
contains
(
".js"
)){
//干掉file:///
//干掉file:///
...
@@ -99,7 +87,7 @@ public class X5WebViewClient extends WebViewClient {
...
@@ -99,7 +87,7 @@ public class X5WebViewClient extends WebViewClient {
String
fileName
=
rootDir
+
"/"
+
newUrl
;
String
fileName
=
rootDir
+
"/"
+
newUrl
;
try
{
try
{
InputStream
is
=
this
.
activity
.
getAssets
().
open
(
fileName
);
InputStream
is
=
parentEngine
.
cordova
.
getActivity
()
.
getAssets
().
open
(
fileName
);
Log
.
e
(
"file"
,
"------ File loaded ---000-0-------------"
);
Log
.
e
(
"file"
,
"------ File loaded ---000-0-------------"
);
return
new
WebResourceResponse
(
mimeType
,
encoding
,
is
);
return
new
WebResourceResponse
(
mimeType
,
encoding
,
is
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
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