Phonegap build - Open external page in InAppBrowser or childbrowser with no toolbar and close it?

后端 未结 2 782
执念已碎
执念已碎 2020-12-03 02:17
  1. I want to open an external page in the InAppBrowser or childbrowser, where I don\'t show any toolbar and where I can have a button in my externalpage that closes th

2条回答
  •  执念已碎
    2020-12-03 02:41

    Here's a simpler solution that may help someone.

    // open win and turn off location 
    var ref = window.open('http://myloginapp.com', '_blank', 'location=no');
    
    // attach listener to loadstart
    ref.addEventListener('loadstart', function(event) { 
        var urlSuccessPage = "http://myloginapp/success/";
        if (event.url == urlSuccessPage) {
        ref.close();    
        }
    });
    

提交回复
热议问题