在inApp Browser Ionic中插入CSS-隐藏URL和地址栏颜色

时间:2018-08-20 12:38:10

标签: ionic-framework ionic2 ionic3 ionic-native

我想隐藏URL并使用“关闭”按钮更改URL栏的颜色,帮帮我,下面是我的代码帮助我将CSS添加到Ionic中的inAPPbrowser

import { InAppBrowser } from '@ionic-native/in-app-browser';
private iab: InAppBrowser
    launch(url) {

        //For Image

        if(url){
          let ext = this.getUrlExtention(url) //To recognize Image or PDF
          console.log("url ext: ", ext);

          if(ext == 'jpg' || ext == "jpeg" || ext == "png")
          this.platform.ready().then(() => {
            this.iab.create(url, "_self");
          });
          //For PDF
          else if(ext == "pdf" || ext == "docx")
          this.platform.ready().then(() => {
              let pdf = encodeURIComponent(url);
              this.iab.create('https://docs.google.com/viewer?url='+pdf, "_self");
          });
        }
        else{
          console.error("url not found: ", url,"  ");

        }
      }

0 个答案:

没有答案