Iframe opens full screen in webview in Android Studio

2

Every time I place an iframe, instead of opening it inside the page, the iframe opens in full screen. Follow project codes

MainActivity.java

    package com.example.duff.webviewoficial;

import android.support.v7.app.AppCompatActivity;


import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {



    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        getSupportActionBar().hide(); //aqui a mágica   REMOVE A BARRA DE TITULO
        getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
        setContentView(R.layout.activity_main);


        WebView mWebView = (WebView) findViewById(R.id.activity_main_webview);

        // Enable Javascript
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true); // Aparentemente habilitado

        mWebView.setWebViewClient(new WebViewClient()
        {
         public boolean shouldOverrideUrlLoading(WebView view, String url){
             view.loadUrl(url);
             return false;
         }
        });

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.duff.webviewoficial">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/logo_home_icon"
        android:label="FarmaLivPlayer"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


    </application>
    <uses-permission android:name="android.permission.INTERNET" />

</manifest>

Page with problem home.html

<!DOCTYPE html>
<html>
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no">
        <link rel="stylesheet" type="text/css" href="view/matriz.css">
        <link rel="stylesheet" type="text/css" href="view/produtos.css">
        <link rel="stylesheet" type="text/css" href="view/paginas.css">
        <script type="text/javascript" src="js/banner.js"></script>
        <script type="text/javascript" src="js/farmaLivPlayer.js"></script>

        <!-- evita abrir em iframe -->

        <script>if (self != top) { top.location.replace(window.location.href) }</script>

        <!-- evita abrir em iframe -->

        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
      <link rel="stylesheet" href="view/master.css">



        <title></title>


    </head>
    <body onload="temporizarSlide()">


        <div id="tudo" >

            <div id="topo" class="transparente">
                    <div id="botaoMenu" class="botoesTopo">
                    <button class="js-menu-show header__menu-toggle material-icons"></button>

                    </div>
                <a href="javascript:home()"><div id="logo" class="botoesTopo"></div></a>
                <a href="javascript:cestinha()"><div id="botaoCestinha"></div></a>
                <div id="botaoLupa" ></div>
            </div>
        <div id="navegacao">
            <div id="banner" >



                    <div id="alvoBanner" style="position: relative; width: 100%; height: 100%; background-color: #ccc;">
                    <img src="view/img/sliders/1slide.png" width="100%" height="100%">

                    </div>
                        <a href="javascript:cliquePushDown()"><div id="pushDown" style="position: absolute;bottom: 0%;left: 50%; ;" onclick="cliquePushDown();"></a>
                        <a href="javascript:cliquePushDown()"><img src="view/img/sliders/pushDownBotao.png" width="100%" height="100%"></a>
                        </div>
            </div>
            <div id="sugestoes" >
                <div id="sugestoesFarmaLiv" class="block"></div>
                <div id="produtosContainer">
                    <iframe src="produtosApp/index.html" width="100%" height="100%" frameborder="0" scrolling="0"></iframe>
                    <div id="blockEsquerdo">
                    </div>
                    <div id="blockDireita">
                    </div>
                </div>
            </div>
            <div id="parceiros" class="transparente">
            </div>
        </div> <!-- fim da navegacao -->
            <div id="botoesFooter" class="transparente">
                <div id="botaoHome" class="botoesFooter" onclick="home()"></div>
                <div id="botaocategorias" class="botoesFooter" onclick="categorias()"></div>
                <div id="botaoDicasDeSaude" class="botoesFooter" onclick="dicasDeSaude()"></div>
                <div id="botaoPerfil" class="botoesFooter"></div>
            </div>
        </div>

        </div>

             <aside class="js-side-nav side-nav">
        <nav class="js-side-nav__container side-nav__container">
          <button class="js-menu-hide side-nav__hide material-icons">X</button>
          <header class="side-nav__header">

          </header>
          <ul class="side-nav__content">
            <li><a href="home.html">Início</li>
            <li><a href="busca.html">Busca</li>
            <!-- código Alerta de Saúde deletado -->
            <li><a href="categorias.html">Categorias</li><li><a href="dicasDeSaude.html">Dicas de saúde</li><li><a href="alertaDeSaude.html">Alerta de saúde</li><li><a href="#">Meus pedidos</li><li><a href="#">Minha conta</li>
          </ul>
        </nav>
      </aside>
      <script src="js/side-nav.js"></script>


                    <div id="seletorImagem">

                    </div>
    </body>
</html>
    
asked by anonymous 15.03.2017 / 22:56

0 answers