zsxsoft / cordova-plugin-x5-tbs Goto Github PK
View Code? Open in Web Editor NEWUse Tencent Browser Service(TBS) instead of System WebView for Cordova App
License: Apache License 2.0
Use Tencent Browser Service(TBS) instead of System WebView for Cordova App
License: Apache License 2.0
目前用的Ionic4,一开始安装的cordova-plugin-x5-webview,,作者也只讲了安装好就可以了,事实证明肯定还有其他的配置需要做,于是我去TBS官网,但我不是搞原生的,看起来很吃力,需要请教一下,除了安装这个插件,还需要配置哪些地方才可以生效,谢谢
如 cordova-plugin-inappbrowser
会使用X5打开网页吗?
懒得pr了……
X5WebChromeClient.java
257行改为:
Uri[] result = android.webkit.WebChromeClient.FileChooserParams.parseResult(resultCode, intent);
因x5会报告
02-05 13:51:04.054 2990-2990/com.ztcrkj.app E/ReflectionUtils: 'com.tencent.smtt.webkit.FileChooserParamsAdapter' invoke static method 'parseFileChooserResult' failed
java.lang.ClassNotFoundException: Didn't find class "com.tencent.smtt.webkit.FileChooserParamsAdapter" on path: DexPathList[[zip file "/data/user/0/com.tencent.mm/app_tbs/core_share/tbs_jars_fusion_dex.jar"],nativeLibraryDirectories=[/data/user/0/com.tencent.mm/app_tbs/core_share, /data/user/0/com.tencent.mm/app_tbs/share/plugins/com.tencent.qb.plugin.videodecode, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.tencent.common.utils.ReflectionUtils.a(Unknown Source)
at com.tencent.common.utils.ReflectionUtils.invokeStaticMethod(Unknown Source)
at com.tencent.tbs.tbsshell.WebCoreProxy.invokeStaticMethod(Unknown Source)
at com.tencent.tbs.tbsshell.WebCoreProxy.parseFileChooserResult(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at com.tencent.smtt.export.external.DexLoader.invokeStaticMethod(Unknown Source)
at com.tencent.smtt.sdk.bl.a(Unknown Source)
at com.tencent.smtt.sdk.WebChromeClient$FileChooserParams.parseResult(Unknown Source)
at com.zsxsoft.cordova.x5.X5WebChromeClient$5.onActivityResult(X5WebChromeClient.java:257)
at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:152)
at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:358)
at android.app.Activity.dispatchActivityResult(Activity.java:7125)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4186)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4233)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1606)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6365)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:791)
02-05 13:51:04.055 2990-2990/com.ztcrkj.app D/X5WebChromeClient: Receive file chooser URL: null
//REALLY? Nobody has seen this UNTIL NOW?
// cookieManager.setAcceptFileSchemeCookies(true);
D:\cordova\EPC>cordova plugin add cordova-plugin-x5-tbs --save
Installing "cordova-plugin-x5-tbs" for android
Android Studio project detected
config file /manifest/uses-sdk requested for changes not found at D:\cordova\EPC\platforms\android\manifest\uses-sdk, ignoring
我直接修改%cordova%\platforms\android\CordovaLib\src\org\apache\cordova.java,
选 import com.tencent.smtt.sdk.QbSdk;
然后在onCreate中加入QbSdk.initX5Environment(this, null);
cordova build android时报错..报com.tencent.smtt.sdk.QbSdk找不到...
platforms\android\lib目录下有(无替换了)tbs_sdk_thirdapp_v3.2.0.1104_43200_sharewithdownload_withfilereader_withoutGame_obfs_20170609_115346
我看了这个jar有 com.tencent.smtt.sdk.QbSdk这个包..
您好
使用您的插件,发现使用[email protected],以上
用6.4.0可以的
编译的时候提示错误,
`cp: copyFileSync: could not write to dest file (code=ENOENT):E:\tmp\hello\platforms\android\res\xml\config.xml
Parsing E:\tmp\hello\platforms\android\res\xml\config.xml failed
(node:144) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'E:\tmp\hello\platforms\android\res\xml\config.xml'
(node:144) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`
Error: Interface com.tencent.smtt.utils.j$a(classpath class)
used as super class of com.tencent.smtt.utils.j$b
.
https://github.com/runner525/x5webview-cordova-plugin
runner525 is a member of tencent's x5 team.
I think you & runner525 could perfecting the x5 cordova plugin together.
如题 使用X5webview后cookie就失效了,具体表现是设置cookie后取不到相应值。
例:
cookie.set('token', 'abc');
cookie.get('token'); // expected output: abc(际拿到的是undefined或者null)
移除cordova-plugin-x5-tbs插件后cookie能正常使用。
猜测原因是官方文档提到的(cookie问题产生的原理是:一段代码把cookie塞给了系统内核,另外一段代码尝试从x5的内核里读取cookie就失败了。类转换的错误产生的原理是:比如xml里指定的是系统的webview,java的代码里把它当作x5的webview使用。)但是就是不知道从哪里入手,求赐教。
RT~
官方的插件不好用.装上后很多cordova插件不能调用
我用 命令安装完,还是3.7.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.