什么是“ isForMainFrame”?请求Android WebViewClient属性中的含义? [英] What is "isForMainFrame" request in Android WebViewClient property meaning?

查看:1534
本文介绍了什么是“ isForMainFrame”?请求Android WebViewClient属性中的含义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 isForMainFrame 的意思是(android-21)?


是否请求了主框架。例如,对于iframe,该字段为false。


尚不清楚,因为对于下面的日志,它返回 false 用于大型机请求。



isMainFrame 在android-19中?



对于 google.com(根据我的区域设置,它立即重定向到 google.ru) android-19的以下日志:

  3068-3088 D / IoThreadClientInvocationHandler:http://www.google的isMainFrame = true .com / 
3068-3088 D / IoThreadClientInvocationHandler:isMainFrame = false表示https://ssl.gstatic.com/gb/images/qi2_00ed8ca1.png
3068-3088 D / IoThreadClientInvocationHandler:isMainFrame = false表示https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png
3068-3088 D / IoT hreadClientInvocationHandler:对于https://www.google.ru/images/nav_logo242_hr.png
3068-3088 D / IoThreadClientInvocationHandler:isMainFrame = false对于https://www.gstatic.com/og/_/ js / k = og.mob.en_US.p8Smm-clGwA.O / rt = j / m = md / exm = mih,mab,meb / d = 1 / ed = 1 / rs = AA2YrTsvrSisM1LDBap6j28t9xwsb4oJBg
3068-3088 D / IoThreadClientInvocationHandler:对于https://www.google.ru/xjs/_/js/k=xjs.qs.ru.WqzjCT34eOw.O/m=sx,c,sb_mob,bct,cdos,elog,isMainFrame = false, hsm,jsa,mbsf,r,qsm,d,csi / am = AIG2TGBhALBBYgn5FBACKAE / rt = j / d = 1 / t = zcms / rs = ACT90oHeC71MlDyUp6g3gXk23kbF4ygyvw
3068-3088 D / IoThreadClientInvocationHandler: //www.google.ru/xjs/_/js/k=xjs.qs.ru.WqzjCT34eOw.O/m=sy7,sy13,em2,sy12,aa,abd,sy55,sy54,sy53,sy57,em10,异步,sy280,sy320,sy319,dvl,sy425,英尺,ipv6,shm / am = AIG2TGBhALBBYgn5FBACKAE / rt = j / d = 0 / t = zcms / rs = ACT90oHeC71MlDyUp6g3gXk23kbF4ygyvw
3068-3088InClient:Handler对于https://www.google.ru/images/branding/product/ico为false /googleg_lodp.ico
3068-3088 D / IoThreadClientInvocationHandler:https://www.google.ru/images/nav_logo242.png
3068-3088 D / IoThreadClientInvocationHandler:https的isMainFrame = false ://www.google.ru/gen_204?v = 3& s = mobilewebhp& atyp = csi& ei = 7kT-V-OSNcOfsgHEgL2gAw& imc = 1& imn = 1& imp = 1& adh =& xjs = init .251.13.sb_mob.199.dvl.23.c.8.async.6.jsa.5& ima = 1& rt = xjsls.161,prt.164,iml.716,dcl.574,xjses.1086,xjsee .1535,xjs.1536,ol.1873,后716,wsrt.1937,cst.728,dnst.1,rqst.219,rspt.36,sslt.721,rqstt.1645,unt.862,cstt.916 ,dit.2155
3068-3088 D / IoThreadClientInvocationHandler:https://www.gstatic.com/og/_/ss/k=og.mob.-1m1er1bg50qhy.LWO/m=md/的isMainFrame = false excm = mih,mab,meb / d = 1 / ed = 1 / rs = AA2YrTuS2ZHRm9kj5jyes52ZN2R47G8RQQ

对于Android -21我可以看到:

  1725-1851 D / IoThreadClientInvocationHandler:21:对于http://www.google.com为真/ 
1725-1851 D / IoThreadClientInvocationHandl错误:21:对于https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png
1725-1851 D / IoThreadClientInvocationHandler:错误:21:对于https://ssl.gstatic错误。 com / gb / images / qi2_00ed8ca1.png
1725-1851 D / IoThreadClientInvocationHandler:21:对于https://www.google.ru/images/nav_logo242_hr.png
1725-1851 D / IoThreadClientInvocationHandler:否: 21:对于https://www.gstatic.com/og/_/js/k=og.mob.en_US.p8Smm-clGwA.O/rt=j/m=md/exm=mih,mab,meb/ d = 1 / ed = 1 / rs = AA2YrTsvrSisM1LDBap6j28t9xwsb4oJBg
1725-1851 D / IoThreadClientInvocationHandler:21:对于https://www.google.ru/xjs/_/js/k=xjs.qs.ru为false。 WqzjCT34eOw.O / m = sx,c,sb_mob,bct,cdos,elog,hsm,jsa,mbsf,r,qsm,d,csi / am = AIG2ZGBGBALBBYgn5FBACKAE / rt = j / d = 1 / t = zcms / rs = ACT90oGqh459Mg-Bg7N2WXgWV78Tvd2J1A
1725-1851 D / IoThreadClientInvocationHandler:21:对于https://www.google.ru/xjs/_/js/k=xjs.qs.ru.WqzjCT34eOw.O/m=sy7,为false sy13,em2,sy12,aa,abd,sy55,sy54,sy53,sy57,em10,异步,sy280,sy320,sy319,dvl,sy425,脚,ipv6,shm ,udlg / am = AIG2ZGBhALBBYgn5FBACKAE / rt = j / d = 0 / t = zcms / rs = ACT90oGqh459Mg-Bg7N2WXgWV78Tvd2J1A
1725-1851 D / IoThreadClientInvocationHandler:21:对于https://www.google.ru/images为false /nav_logo242.png
1725-1851 D / IoThreadClientInvocationHandler:21:对于https://www.google.ru/gen_204?v=3&s=mobilewebhp&atyp=csi&ei=Qkb-V4-7AoOisAGdzq24Bg& ; imc = 1& imn = 1& imp = 1& adh =& xjs = init.181.13.sb_mob.151.c.12.mbsf.4.jsa.4.async.4& conn = unknown& ima = 1& ; rt = xjsls.146,prt.155,iml.4995,dcl.4791,xjses.5597,xjsee.6069,xjs.6070,ol.6264,aft.4995,wsrt.1045,cst.155,dnst.0 ,rqst.127,rspt.9,sslt.147,rqstt.837,unt.671,cstt.681,dit.1305
1725-1851 D / IoThreadClientInvocationHandler:21:对于https://www.gstatic为false .com / og / _ / ss / k = og.mob.-1m1er1bg50qhy.LWO / m = md / excm = mih,mab,meb / d = 1 / ed = 1 / rs = AA2YrTuS2ZHRm9kj5jyes52ZN2R47G8RQQ
1725-1851 D / IoThreadClientInvocationHandler:21:对于https://www.google.ru/images/branding/product/1x/gsa_shadowed_144dp.png


我希望所有资源都能看到 true ,因为它是来自主框架(和单个框架)的资源在 google.ru。我错了吗?

解决方案

isForMainFrame 方法实际上是从WebKit继承的。例如,这里是 Apple文档



因此,这里MainFrame指的是WebKit概念,它是根WebFrame。


在后台,WebFrame对象封装了包含在单个frame元素中的内容。 WebFrame对象的层次结构用于对整个网页进行建模,其中根称为主框架


有关详细信息,请参见文档



通过此定义,只有初始请求是针对主框架的,其余是对子WebFrame的请求。


What is isForMainFrame meaning (android-21)?

whether the request was made for the main frame. Will be false for iframes, for example.

is not clear, since for the log below it returns false for main frame requests.

Is it the same as isMainFrame in android-19?

For "google.com" (which is immediately redirected to "google.ru" according to my locale) i'm getting the following log for android-19:

3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=true for http://www.google.com/
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://ssl.gstatic.com/gb/images/qi2_00ed8ca1.png
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.google.ru/images/nav_logo242_hr.png
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.gstatic.com/og/_/js/k=og.mob.en_US.p8Smm-clGwA.O/rt=j/m=md/exm=mih,mab,meb/d=1/ed=1/rs=AA2YrTsvrSisM1LDBap6j28t9xwsb4oJBg
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.google.ru/xjs/_/js/k=xjs.qs.ru.WqzjCT34eOw.O/m=sx,c,sb_mob,bct,cdos,elog,hsm,jsa,mbsf,r,qsm,d,csi/am=AIG2TGBhALBBYgn5FBACKAE/rt=j/d=1/t=zcms/rs=ACT90oHeC71MlDyUp6g3gXk23kbF4ygyvw
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.google.ru/xjs/_/js/k=xjs.qs.ru.WqzjCT34eOw.O/m=sy7,sy13,em2,sy12,aa,abd,sy55,sy54,sy53,sy57,em10,async,sy280,sy320,sy319,dvl,sy425,foot,ipv6,shm/am=AIG2TGBhALBBYgn5FBACKAE/rt=j/d=0/t=zcms/rs=ACT90oHeC71MlDyUp6g3gXk23kbF4ygyvw
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.google.ru/images/branding/product/ico/googleg_lodp.ico
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.google.ru/images/nav_logo242.png
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.google.ru/gen_204?v=3&s=mobilewebhp&atyp=csi&ei=7kT-V-OSNcOfsgHEgL2gAw&imc=1&imn=1&imp=1&adh=&xjs=init.251.13.sb_mob.199.dvl.23.c.8.async.6.jsa.5&ima=1&rt=xjsls.161,prt.164,iml.716,dcl.574,xjses.1086,xjsee.1535,xjs.1536,ol.1873,aft.716,wsrt.1937,cst.728,dnst.1,rqst.219,rspt.36,sslt.721,rqstt.1645,unt.862,cstt.916,dit.2155
3068-3088 D/IoThreadClientInvocationHandler: isMainFrame=false for https://www.gstatic.com/og/_/ss/k=og.mob.-1m1er1bg50qhy.L.W.O/m=md/excm=mih,mab,meb/d=1/ed=1/rs=AA2YrTuS2ZHRm9kj5jyes52ZN2R47G8RQQ

for android-21 i can see:

1725-1851 D/IoThreadClientInvocationHandler: 21: true for http://www.google.com/
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://ssl.gstatic.com/gb/images/qi2_00ed8ca1.png
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.google.ru/images/nav_logo242_hr.png
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.gstatic.com/og/_/js/k=og.mob.en_US.p8Smm-clGwA.O/rt=j/m=md/exm=mih,mab,meb/d=1/ed=1/rs=AA2YrTsvrSisM1LDBap6j28t9xwsb4oJBg
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.google.ru/xjs/_/js/k=xjs.qs.ru.WqzjCT34eOw.O/m=sx,c,sb_mob,bct,cdos,elog,hsm,jsa,mbsf,r,qsm,d,csi/am=AIG2ZGBhALBBYgn5FBACKAE/rt=j/d=1/t=zcms/rs=ACT90oGqh459Mg-Bg7N2WXgWV78Tvd2J1A
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.google.ru/xjs/_/js/k=xjs.qs.ru.WqzjCT34eOw.O/m=sy7,sy13,em2,sy12,aa,abd,sy55,sy54,sy53,sy57,em10,async,sy280,sy320,sy319,dvl,sy425,foot,ipv6,shm,udlg/am=AIG2ZGBhALBBYgn5FBACKAE/rt=j/d=0/t=zcms/rs=ACT90oGqh459Mg-Bg7N2WXgWV78Tvd2J1A
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.google.ru/images/nav_logo242.png
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.google.ru/gen_204?v=3&s=mobilewebhp&atyp=csi&ei=Qkb-V4-7AoOisAGdzq24Bg&imc=1&imn=1&imp=1&adh=&xjs=init.181.13.sb_mob.151.c.12.mbsf.4.jsa.4.async.4&conn=unknown&ima=1&rt=xjsls.146,prt.155,iml.4995,dcl.4791,xjses.5597,xjsee.6069,xjs.6070,ol.6264,aft.4995,wsrt.1045,cst.155,dnst.0,rqst.127,rspt.9,sslt.147,rqstt.837,unt.671,cstt.681,dit.1305
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.gstatic.com/og/_/ss/k=og.mob.-1m1er1bg50qhy.L.W.O/m=md/excm=mih,mab,meb/d=1/ed=1/rs=AA2YrTuS2ZHRm9kj5jyes52ZN2R47G8RQQ
1725-1851 D/IoThreadClientInvocationHandler: 21: false for https://www.google.ru/images/branding/product/1x/gsa_shadowed_144dp.png

I expected to see true for all the resources since it's the resources from the main (and single) frame at "google.ru". Am i wrong?

解决方案

The isForMainFrame method is actually inherited from WebKit. For instance, here is in the Apple docs

Thus, here MainFrame refers to the WebKit concept, which is the root WebFrame.

Behind the scenes, WebFrame objects encapsulate the content contained in a single frame element. A hierarchy of WebFrame objects is used to model an entire webpage where the root is called the main frame

You can find more on that in the docs

By this definition, only the initial request is for the "main frame", the rest are requests for the children WebFrames.

这篇关于什么是“ isForMainFrame”?请求Android WebViewClient属性中的含义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆