by: Andronama
Created: –
Category: Programming
Views: 87


According to the current Guildlines of the Apple app store, are iOS browsers using WebView prohibited?

Current Apple App Store guidelines say

4.7 HTML5 Games, Bots, etc.

Applications can contain or execute code that is not embedded in the binary (for example, HTML5-based games, bots, etc.), as long as the code distribution is not the primary purpose of the application, the code is not offers in-store or store-like interface, and provided the software (1) is free or purchased in-app purchase; (2) only uses capabilities available in a standard WebKit view (for example, it must be natively opened and run in Safari without modification or additional software); your application must use WebKit and JavaScript Core to run third-party software and must not attempt to extend or expose the native APIs of the platform to third-party software; (3) is offered by developers who have joined the Apple Developer Program and have signed the Apple Developer Program License Agreement; (4) does not provide access to real money games, lotteries, or charitable donations; (5) adheres to the terms of these Application Review Guidelines (for example, does not include objectionable content); and (6) does not offer digital products or services for sale. Upon request, you must provide an index of software and metadata available in your application. You must include the team IDs from the Apple Developer Program for software vendors along with a URL that App Review can use to confirm that the software meets the above requirements.

That seems like all third party browsers are banned. Breaking it down

Applications can … execute code that is not embedded in the binary

Ok that's a browser

… as long as the software …

But they must follow these rules.

your application must use WebKit and JavaScript Core

and all the software runs in your embedded webkit view

is offered by developers who have joined the Apple Developer Program and signed the Apple Developer Program License Agreement

Which means that downloading random web pages that run software from users and sites that are not in the Apple Developer Programs runs counter to those rules.

That would mean that all third party browsers are banned. I don't see any exceptions for browsers. Mention running "HTML5 Games, Bots, etc …" Well, browsers run HTML5 Games and run "etc …"

What am I missing?

activity – The page in my WebView opens a new tab and I cannot access it – Android

I am making an app in which an option is only an activity that consists only of a WebView where I have the company page, the page is already responsive, so that within the app it is perfect. The problem occurs that the company page has a button where it opens a new tab keeping the previous one, in Chrome it works well because it brings me the focus to the new tab, the problem that I do not want to open the browser in my app, then it stays the WebView on the first screen and I can never see the second tab that the button generates. I already tried it in many ways and I can't get my webview to reload with the second screen.
   Try using the shouldOverrideUrlLoading to detect the change but since it does not reload the page but opens the new tab it does not generate the event.
  I would need if you could help me since I have everything ready and this button is ruining my delivery

Thank you in advance

mobile – Download | WebView | Android

Hi, I have problems downloading the application.

All the codes I implemented did not work when they did not close the application.

I will put the codes below, if any of you can help me, I will be very grateful.


import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.DownloadListener;
import android.webkit.URLUtil;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.Toast;

import androidx.core.content.ContextCompat;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
public class MainActivity extends AppCompatActivity {

    public WebView webView;
    private float m_downX;
    private ProgressBar progressBar;
    private SwipeRefreshLayout mySwipeRefreshLayout;

    private static final int STORAGE_PERMISSION_CODE = 123;
    private final static int FILECHOOSER_RESULTCODE=1;
    private ValueCallback mUploadMessage;

    public void onCreate(Bundle savedInstanceState) {
        getSupportActionBar().hide(); //aqui a mágica
        webView = findViewById(;
        progressBar = findViewById(;


        webView.setDownloadListener(new DownloadListener() {

            @SuppressLint("InlinedApi") public void onDownloadStart(String url, String userAgent,
                                                                    String contentDisposition, String mimetype,
                                                                    long contentLength) {
                DownloadManager.Request request = new DownloadManager.Request(

                final String filename = URLUtil.guessFileName(url, contentDisposition, mimetype);
                request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); //Notify client once download is completed!
                request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename);
                DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); //This is important!
                intent.addCategory(Intent.CATEGORY_OPENABLE); //CATEGORY.OPENABLE
                intent.setType("*/*");//any application,any extension
                Toast.makeText(getApplicationContext(), "Baixando!", //To notify the Client that the file is being downloaded


    private void getInternetStatus() {

    //Requesting permission
    private void requestStoragePermission() {
        if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED){

        if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.READ_EXTERNAL_STORAGE)) {
            //If the user has denied the permission previously your code will come to this block
            //Here you can explain why you need this permission
            //Explain here why you need this permission
        //And finally ask for the permission
        ActivityCompat.requestPermissions(this, new String(){android.Manifest.permission.READ_EXTERNAL_STORAGE}, STORAGE_PERMISSION_CODE);

    public void onRequestPermissionsResult(int requestCode, String() permissions, int() grantResults) {

        //Checking the request code of our request
        if (requestCode == STORAGE_PERMISSION_CODE) {

            //If permission is granted
            if (grantResults.length > 0 && grantResults(0) == PackageManager.PERMISSION_GRANTED) {
                //Displaying a toast
//                Toast.makeText(this, "Permission granted now you can read the storage", Toast.LENGTH_LONG).show();
            } else {
                //Displaying another toast if permission is not granted
//                Toast.makeText(this, "Oops you just denied the permission", Toast.LENGTH_LONG).show();

    private void openFileExplorer(){
        Intent i = new Intent(Intent.ACTION_GET_CONTENT);
        MainActivity.this.startActivityForResult( Intent.createChooser( i, "File Chooser" ), MainActivity.FILECHOOSER_RESULTCODE );

    protected void onActivityResult(int requestCode, int resultCode,
                                    Intent intent) {
        super.onActivityResult ( requestCode, resultCode, intent );
        if (requestCode == FILECHOOSER_RESULTCODE) {
            if (null == mUploadMessage) return;
            Uri result = intent == null || resultCode != RESULT_OK ? null
                    : intent.getData ();
            if (result == null) {
                mUploadMessage.onReceiveValue ( null );
            } else {
                mUploadMessage.onReceiveValue ( new Uri(){result} );
            mUploadMessage = null;

    public void requestCameraPermission() {
        if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {

            ActivityCompat.requestPermissions(this, new String() { android.Manifest.permission.CAMERA, android.Manifest.permission.WRITE_EXTERNAL_STORAGE }, 0);

    public void onBackPressed() {
        if (webView.canGoBack()) {
    private void initWebView() {
        webView.setWebChromeClient(new MyWebChromeClient(this));
        webView.setWebViewClient(new WebViewClient() {
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                super.onPageStarted(view, url, favicon);

            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return true;

            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
//                mySwipeRefreshLayout.setRefreshing(false);

            public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
                super.onReceivedError(view, request, error);
//                mySwipeRefreshLayout.setRefreshing(false);


        webView.setOnTouchListener(new View.OnTouchListener() {
            public boolean onTouch(View v, MotionEvent event) {

                if (event.getPointerCount() > 1) {
                    //Multi touch detected
                    return true;

                switch (event.getAction()) {
                    case MotionEvent.ACTION_DOWN: {
                        // save the x
                        m_downX = event.getX();

                    case MotionEvent.ACTION_MOVE:
                    case MotionEvent.ACTION_CANCEL:
                    case MotionEvent.ACTION_UP: {
                        // set x so that it doesn't move
                        event.setLocation(m_downX, event.getY());

                return false;

    private void back() {
        if (webView.canGoBack()) {

    private void forward() {
        if (webView.canGoForward()) {

    private class MyWebChromeClient extends WebChromeClient {
        Context context;

        public MyWebChromeClient(Context context) {
            this.context = context;

        public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback,
                                         FileChooserParams fileChooserParams) {
            mUploadMessage = filePathCallback;

            return true;





Android Studio – Save the status of a WebView

I have a doubt about whether it is possible to save the status of a WebView once it has finished loading, I explain, I have a Fragment where I load a web page through a WebView, this WebView loads without any problem, but when I change this fragment to another and back to where my WebView was reloaded, then I want to know if it is possible that using the methods of onSaveInstanceState and the method of onViewStateRestored I can save the status of my WebView in that fragment so that every time I change the snippet and come back I don't reload the entire website.

This is the fragment where I have all my code:

public class InicioFragment extends Fragment {

    WebView webViewBlog;
    private LinearLayout superLinearLayout;
    private ProgressBar superProgressbar;
    private String myCurrentURL;

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, final Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_home, container, false);

        if (savedInstanceState != null) {
        }else {

            webViewBlog = root.findViewById(;
            superLinearLayout = root.findViewById(;
            superProgressbar = root.findViewById(;

            webViewBlog.setWebViewClient(new WebViewClient(){

                public void onPageStarted(WebView view, String url, Bitmap favicon) {
                    super.onPageStarted(view, url, favicon);

                public void onPageFinished(WebView view, String url) {
                    super.onPageFinished(view, url);
                    myCurrentURL = url;
            webViewBlog.setWebChromeClient(new WebChromeClient(){
                public void onProgressChanged(WebView view, int newProgress) {
                    super.onProgressChanged(view, newProgress);

                public void onReceivedTitle(WebView view, String title) {
                    super.onReceivedTitle(view, title);



        return root;

    public void onSaveInstanceState(@NonNull Bundle outState) {
        Log.i("INSTANCIA","onSaveInstanceState: "+webViewBlog);

    public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
        Log.i("INSTANCIA","onViewStateRestored: "+savedInstanceState);

    public void onStop() {
        Log.i("INSTANCIA","Metodo onStop");

    public void onPause() {
        Log.i("INSTANCIA","Metodo onPause");

    public void onResume() {
        Log.i("INSTANCIA","Metodo onResume");

    public void onDestroy() {
        Log.i("INSTANCIA","Metodo onDestroy: "+getSavedStateRegistry());

    public void onDetach() {
        Log.i("INSTANCIA","Metodo onDetach");

javascript: What is the worst security issue? What can happen when using eval () in Android WebView?

I have come across a hybrid Android application, which means that most of its user interface is implemented in a WebView using HTML and JavaScript technologies. The application itself is connecting to the server and one of the possible responses may include evaluate field, which then runs directly through JavaScript eval() I send.

Is this a security issue? What kind of attacks can the attacker make through this attack vector?

WebView vs GeckoView to play embedded YouTube videos

In my application I have a WebView Load a URL with an embedded YouTube video (using iframe). Using standard Android WebView, reproduction is not fluid with random pauses and average reproduction quality. In contrast to this, everything works fine and playback is comparable to PC execution when used. GeckoView (Based on FireFox motor).

Any idea what could be causing the problematic problems when using Android WebView? Problems not seen when using GeckoView?

Is Mobile – Webview useful for use as an application's user interface?

You can skip if you want to answer the question directly, but you can lose the motivation that I ask a bit and make the answer difficult.

I saw an article by Steve Sanderson that talked about an experimental project called WebWindow that uses a Webview component available in the operating system to use it as an application user interface.

All this has to do with Blazor, which allows you to use your model differently. I think I understood the advantages and disadvantages of each form of use:

UI comparison chart with Blazor
Click to see it better.

1	Servidor impõe penalidade. O WebAssembly é sempre inferior ao nativo para sua aplicação, mas o que mais importa é a UI			
2	Só por causa da UI. O ideal seria ter parâmetros mais precisos			
3	Carga inicial do *runtime*. Fora a aplicação em si. Dados bem aproximados. Server: fica maior que 0 se usar Angular, React, etc.			
4	Aqui é sobre a carga para uso e não o primeiro uso que depende de baixar algo. Server: as trocas de página são lentas. Tem tecnologia que não é tão baixo assim e pode ser maior que web em alguns casos			
5	Se precisa de alguma ação do usuário entre ele chegar onde tem a aplicação e começar usar (não é sobre precisar de um instalador)			
6	Se você decide quando o renderizador final (gráfico) muda a versão e possivelmente cria falhas na aplicação. O SO pode mudar algo, mas é raro quebrar compatibilidade, web não é assim, ainda que melhorou			
7	Problemas diferentes em cada um, pode faltar componente ou não ser na versão desejada e executar algum um pouco diferente do esperado, até falhar, em alguns casos por ação indevida do usuário			
8	Como se parece e interage? Fica como é a plataforma base que está rodando? Web já é meio padronizado, próprio não. Nativo é bom pra plataforma, mas não ajuda quem usa mais de uma			
9	Usa de forma simples e sem sobressaltos? Faz tudo o que deve fazer sem perceber nada esquisito, demoras, ou gerar algum mínimo desconforto comparando com outras opções (por exemplo poder cometer erros porque tem controle sobre o que não é bem sua aplicação, ex.: navegação do browser)			
10	Minha percepção da satisfação do usuário usando (não confio na opinião dele, ele se engana quando comenta sobre, é quase subliminar)			
11	O usuário tem que tomar algum cuidado? Ele pode causar problema na hora de começar usar ou depois fazer algo errado, precisa de esforço adicional para atualizar, por parte do usuário ou do programador? Tem facilidade de manter tudo protegido (um só arquivo)?			
12	Por busca ou canal próprio de divulgação sempre dá por padrão. Estou desconsiderando que a Play Store não serve pra divulgar nada e fora a App Store as outras quase não são usadas			
13	A UI roda no Windows, Android, iOS, Linux, MacOS sem grandes alterações?			
14	Dá muito trabalho para fazer o código se comportar bem em todas plataformas que ele roda? Nativo: Considerando que cada plataforma tem uma base de código e uma não atrapalha a outra			
15	Se usa HTML/CSS ou outra forma (XAML, código, etc.)			
16	Se tem acesso nativo ao OS roda direto na API do SO ou tem alguma camada entre ela			
17	Aqui vai além da UI, dá para acessar qualquer recurso da máquina? Fazer cache? Comunicar por protocolo mais eficiente que HTTP?			
18	É fácil modelar e estilizar a UI? Ou seja, tem que mexer com CSS? :) Ou como dizem "responsivo" argh. Lida bem com mudança de orientação (Isso vale mais pra mobile, mas em certa medida desktop também porque não é só sobre orientação, se ele se vira sozinho quando "o formato da tela" muda)			
19	Dentro do normal que se faz precisa atualizar a aplicação quando muda a composição da UI ou é possível trocar sem mexer na aplicação. Pode contornar dificuldades de atualização com Store. Claro que é possível dar dinamismo em qualquer caso, mas alguns não é comum e depende de esforço extra			
20	Depende de conexão de internet para funcionar? Desde que faça algum sentido a aplicação rodar isolada			
21	Para aplicação não costuma importar, mas não deixa de ser um critério a ser pesado se for necessário			
22	Como é estruturado e manipulado o DOM ou algo semelhante que controla o layout			
23	Isso tem a ver principalmente com tempo, mas também pode envolver outras variáveis como custo do profissional ou infra necessária			
24	Se é fácil mexer depois de pronto? Tem muito caso que depois vira um drama arrumar mesmo que seja "fácil" fazer. Se tem que arrumar coisas por culpa do modelo adotado na tecnologia escolhida			
25	Cada modelo impõe uma forma de debugar o código e tem melhores ou piores ferramentas			
26	Minha percepção do que a comunidade usa e sustenta, principalmente mantendo a tecnologia fresca. Não é só documentação, qualquer coisa que ajude o desenvolvimento			
27	Minha percepção da quantidade e qualidade dos profissionais trabalhando com isso (não estou olhando proporção)			
Server: SSR, a renderização do layout é no servidor e o gráfico visível é no cliente			
Browser: WebAssembly com .NET			
PWA: O mesmo com alguns detalhes extras para habilitar esta tecnologia			
Desktop: Electron			
Webview: Novo WebWindow (link do Sanderson)			
Nativo: Blazor experimental que abstrai a UI nativa do OS (provavelmente)			
OS Nativo: WinForms, WPF, WinUI, GTK, Xamarin, etc.			
Abstração do nativo: Eto Forms, Xamarin Forms, Uno, etc.			
Renderização própria: Avalonia...			
O que tem "talvez" é que depende de algum esforço próprio ou dependência			
"varia" depende de onde está rodando. Alguns casos talvez fosse melhor separar por tecnologia ou modelo específico, mas ficaria uma tabela muito grande e o foco é Blazor			
O "?" é que não se tem informação suficiente			
Não tome a tabela como correta.			
Só considere a UI e a capacidade de ir além, mas não como vai além, especialmente em pontos como performance (não importa o resto do processamento			
Não considerei o fato de algumas formas destas não estarem prontas e até podem não se tornar produtos viáveis, minha visão é para longo prazo. Considerei tecnologias base disponíveis para o sistema operacional para uso com C#.			
Note que usar C# (quando o Blazor pronto) no lugar de JS é teme muito mais performance, mas não sei bem o quanto. Poderia ter comparado com outras tecnologias, mas meu foco é este.			
Não estou considerando o uso para aplicações muito complexas e de alta necessidade, só para uso mais normal de aplicativos comuns.			

Sorry for the abuse of fragmentbut I thought it was better that way

For those who do not know, Blazor is just the programming model and is not responsible for the final representation. You can structure how the screens will be mounted, but you don't do that job that is always done by the browser-like component or the operating system component.

My question is about Webview that has been around for a while (it's not about Blazor, just deciding to use it), I've seen criticism and compliments, and everything I've read seems to be one of those technologies that people love or love. I hate it

It seems that this technique is proliferating (it is no longer just for mobile use and for the most part seems to be ceasing to be punctual).

I have even seen it in the Android documentation, which seems to have popularized the technique, saying that it is not so recommended:

In most cases, we recommend using a standard web browser, such as Chrome, to deliver content to the user.

Not only that, I have seen much debate on the subject, but some admit that in the past it was worse and improved.

I am not talking about using Webview for something on time when it would be complicated or impossible to do it differently, I am talking about using it as the main and even unique user interface of your application. Nor do I speak of the general question that I think I have already helped with the previous table. So, the question is for anyone who has experience in using Webview in this way and can say something based on that experience about the specific use.

Does Webview have a problem being used as an application user interface?

And yet, do you see any problem with the approach that the article linked Above shows what will be used?

It is not fundamental to the question, but does it have any point on the WebView table that deserves a better specification within the context of the question? For example, about performance, it may be true, but is it a significant difference?

Is there anything in the table regarding WebView that is not true even though it was one day? (It only helps the context of the question).

A balanced response without setting aside, if possible, has more value. In general, technologies not only have advantages or disadvantages.

Disclaimer: It seems to me incorrect to use the web as a user interface of anything other than casual or punctual, I just want to understand better, even to soften my position, if applicable.

webview: is it possible to disable auto focus mode when using the camera on a web page?

I am developing a web-based stock management application and I am using an Android phone camera to scan barcodes.
It works well, the problem is only with the autofocus of the camera. Is it possible to disable it while using the device's camera on a web page? Or is there an application that disables the camera's auto focus globally on the phone? Or some potential solution?
I hope my question is clear, thanks in advance for your help!