我想隐藏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," ");
}
}