In ons-modal, display Loading... and access the website with InAppBrowser in the hidden state.
The loadstop event fires upon completion of loading, so close ons-modal to display InAppBrowser.
However, it does not work if you specify an external browser (_system).
ons-modal
InAppBrowser plug-in
HTML
<ons-page>
<ons-toolbar>
<div class="center">Test</div>
</ons-toolbar>
<br>
<ons-button onclick="showWeb()">Website View</ons-button>
</ons-page>
<ons-modal>
<div style="text-align:center;">
<p>ons-iconion="md-spinner" size="28px" spin>/ons-icon>> Loading...</p>
</div>
</ons-modal>
JavaScript
"use strict";
ons.ready(function(){
console.log("Onsen UI is ready!");
});
function showWeb() {
varmodal= document.querySelector("ons-modal");
modal.show();
var ref=window.open("http://ja.stackoverflow.com/", "_blank", "location=no, hidden=yes");
ref.addEventListener("loadstop", function(e){
modal.hide();
ref.show();
});
}
1949 I want to connect to the webcam from WSL(ubuntu)
1921 M2 Mac fails to install rbenv install 3.1.3 due to errors
1752 Error in x, y, and format string must not be None
1751 I want to run pyautogui without remote connection on Windows 10 in the cloud
1788 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2026 OneMinuteCode. All rights reserved.