Giter VIP home page Giter VIP logo

x5webview-cordova-plugin-new's Introduction

x5webview-cordova-plugin

x5webview-cordova-plugin 是腾讯浏览服务(TBS)为cordova框架提供的用于android平台的cordova插件,旨在为android平台提供更好的webview浏览体验.

一.接入步骤: 1.向cordiva工程中添加x5webview插件,有如下两种方式:

(1)cordova plugin add x5webview-cordova-plugin 
(2)cordova plugin add https://github.com/runner525/x5webview-cordova-plugin.git

2.向ionic4,5的cordova工程中添加x5webview插件指引:

1.修改cordova-plugin-ionic-webview插件中的:

IonicWebViewEngine.java:

android.webkit.WebResourceRequest ——> import com.tencent.smtt.export.external.interfaces.WebResourceRequest;

android.webkit.WebResourceResponse ——> import com.tencent.smtt.export.external.interfaces.WebResourceResponse;

android.webkit.ServiceWorkerClient ——> com.tencent.smtt.export.external.interfaces.ServiceWorkerClient;

android.webkit.WebSettings ——> import com.tencent.smtt.sdk.WebSettings;

android.webkit.WebView ——> import com.tencent.smtt.sdk.WebView;

android.webkit.ServiceWorkerController ——> com.tencent.smtt.sdk.ServiceWorkerController;

import org.apache.cordova.engine.SystemWebViewClient; ——> import org.apache.cordova.x5engine.X5WebViewClient;

import org.apache.cordova.engine.SystemWebViewEngine; ——> import org.apache.cordova.x5engine.X5WebViewEngine;

import org.apache.cordova.engine.SystemWebView; ——> import org.apache.cordova.x5engine.X5WebView;

WebViewLocalServer.java:

android.webkit.WebResourceRequest ——> import com.tencent.smtt.export.external.interfaces.WebResourceRequest;

android.webkit.WebResourceResponse ——> import com.tencent.smtt.export.external.interfaces.WebResourceResponse;

2.修改x5webview-cordova-plugin-new插件中的plugin.xml

注释掉:

<preference name="webView" value="org.apache.cordova.x5engine.X5WebViewEngine"/>

3.App 首次就可以加载 x5 内核: 把本项目代码中的MainActivity.java文件,修改成自己app的包名后,换掉platform中的原MainActivity.java后打包(目前没有好的办法,只能add android后手动替换)

二.熟悉android开发的同学可以参考x5官网来灵活使用x5内核.常用链接如下:

官网(https://x5.tencent.com/tbs/)

常见问题(https://x5.tencent.com/tbs/faq.html)

论坛(http://bbs.mb.qq.com/forum-112-1.html)

内核加载问题检测工具(http://bbs.mb.qq.com/thread-1944983-1-1.html)

x5webview-cordova-plugin-new's People

Contributors

fssgh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

x5webview-cordova-plugin-new's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.