How to hide url in Chrome custom tab android

∥☆過路亽.° 提交于 2019-12-19 05:03:45

问题


I have implemented new Chrome Custom Tab in android, I am using the following code to open

Uri uri = Uri.parse("https://akash.plobal.com/ploicy");
CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();                   
intentBuilder.setToolbarColor(Color.BLACK);
intentBuilder.setShowTitle(true);
intentBuilder.build().launchUrl(getActivity(), uri);

I need to hide url below the title in toolbar


回答1:


If you control both the content and the application, you can use Trusted Web Activities to completely remove the URL bar. You'll need to implement Digital Asset Links to validate the ownership of both.

If you don't own the content, it is not possible to hide the URL below the title. The URLs needs to visible to the user, so that they can know in which site they are. By removing this from the UI, a malicious site could mimic the UI of another one, and this could potentially create a security issue for users.




回答2:


If you control both the content and the application, you can use Trusted Web Activities to completely remove the URL bar. You'll need to implement Digital Asset Links to validate the ownership of both.

If you don't own the content, it is not possible to hide the URL below the title. The URLs needs to visible to the user, so that they can know in which site they are. By removing this from the UI, a malicious site could mimic the UI of another one, and this could potentially create a security issue for users.




回答3:


You cannot hide the url alone. You can only get rid of the whole title bar, that too when the user scroll the view. To achieve this,use

intentBuilder.enableUrlBarHiding();




回答4:


You can try setShowTitle(false) of your custom tab.



来源:https://stackoverflow.com/questions/40101827/how-to-hide-url-in-chrome-custom-tab-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!