Skip to content
Permalink
Browse files
CB-3420: add hidden option to InAppBrowser
  • Loading branch information
David Kemp committed Jun 4, 2013
1 parent 038efb5 commit 100b954da984f421ee48a41bdddf32af928a5b34
Showing 1 changed file with 28 additions and 0 deletions.
@@ -173,6 +173,29 @@
});
}
}
var hiddenwnd=null;
var loadlistener = function(event) { alert('background window loaded ' ); };
function openHidden(url, startHidden) {
var shopt =(startHidden) ? 'hidden=yes' : '';
hiddenwnd = window.open(url,'random_string',shopt);
if (!hiddenwnd) {
alert('window.open returned ' + hiddenwnd);
return;
}
if(startHidden) hiddenwnd.addEventListener('loadstop', loadlistener);
}
function showHidden() {
if(!!hiddenwnd ) {
hiddenwnd.show();
}
}
function closeHidden() {
if(!!hiddenwnd ) {
hiddenwnd.removeEventListener('loadstop',loadlistener);
hiddenwnd.close();
hiddenwnd=null;
}
}
</script>
</head>
<body onload="init();" id="stage" class="theme">
@@ -225,6 +248,11 @@ <h1>CSS / JS Injection</h1>
<div class="btn large" onclick="openWithScript('inject.html', 'inject.js', true);">Script File Injection (CB)</div>
<div class="btn large" onclick="openWithScript('inject.html');">Script Literal Injection</div>
<div class="btn large" onclick="openWithScript('inject.html', null, true);">Script Literal Injection (CB)</div>
<h1>Open Hidden </h1>
<div class="btn large" onclick="openHidden('http://google.com',true);">google.com hidden</div>
<div class="btn large" onclick="showHidden();">show hidden</div>
<div class="btn large" onclick="closeHidden();">close hidden</div>
<div class="btn large" onclick="openHidden('http://google.com',false);">google.com not hidden</div>
<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
</body>
</html>

0 comments on commit 100b954

Please sign in to comment.