101 lines
3.0 KiB
HTML
101 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
|
|
<title></title>
|
|
<script src="../../js/publics/jquery-3.6.0.min.js" type="text/javascript"></script>
|
|
</head>
|
|
<style>
|
|
html,
|
|
body {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
body {
|
|
background-color: rgb(228, 228, 228);
|
|
overflow: hidden;
|
|
}
|
|
|
|
* {
|
|
margin: 0px;
|
|
padding: 0px;
|
|
}
|
|
|
|
.iframediv {
|
|
width: 100%;
|
|
height: 100%;
|
|
/* margin: 100px auto; */
|
|
/* border: 10px dashed rgb(58, 58, 58); */
|
|
overflow: hidden;
|
|
}
|
|
|
|
.iframediv iframe {
|
|
width: 100%;
|
|
height: 100%;
|
|
top: 0;
|
|
left: 0;
|
|
transform-origin: top left;
|
|
transform: scale(1)
|
|
}
|
|
.container-title{
|
|
display: none;
|
|
}
|
|
</style>
|
|
<body>
|
|
<div class="iframediv">
|
|
<iframe id="iframe" allowfullscreen allow="microphone;camera;midi;encrypted-media;" ></iframe>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
user_name="CS918F";
|
|
let url="https://caps.runde.pro/api/index.php?ctl=tool&act=get_pkey&user_name="+user_name+"&pwd=CS123456dl@";
|
|
let iframeUrl;
|
|
console.log(url);
|
|
var httpRequest = new XMLHttpRequest();
|
|
httpRequest.open('GET', url, false);
|
|
httpRequest.send();
|
|
console.log(httpRequest.responseText);
|
|
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
|
|
var json = JSON.parse(httpRequest.responseText);
|
|
pkey=json.data;
|
|
var getTokenUrl="https://caps.runde.pro/api/index.php?ctl=tool&act=get_token&user_name="+user_name+"&pkey="+pkey
|
|
console.log(getTokenUrl);
|
|
httpRequest.open('GET', getTokenUrl, false);
|
|
httpRequest.send();
|
|
var json2 = JSON.parse(httpRequest.responseText);
|
|
iframeUrl="https://caps.runde.pro/login#token="+json2.session_id+"&user_name="+user_name+"&target=home";
|
|
console.log(iframeUrl);
|
|
document.getElementById("iframe").src=iframeUrl;
|
|
|
|
var iframeDocument = document.getElementById('iframe').contentDocument || document.getElementById('iframe').contentWindow.document;
|
|
console.log("---------->");
|
|
var elements = iframeDocument.getElementsByClassName('container-title');
|
|
var elements2 = iframeDocument.getElementsByClassName('.container-title');
|
|
//
|
|
setTimeout(onload, 8000); // 5秒后加载脚本
|
|
console.log("---------->");
|
|
console.log(elements);
|
|
console.log(elements2);
|
|
console.log(iframeDocument);
|
|
}
|
|
// window.onload = function() {
|
|
// var iframeDocument = window.document.getElementById('iframe').contentDocument || window.document.getElementById('iframe').contentWindow.document;
|
|
// var elements = iframeDocument.getElementsByClassName('title');
|
|
// console.log("---------->ABCD");
|
|
// console.log(elements);
|
|
// }
|
|
function onload(){
|
|
var iframeDocument = document.getElementById('iframe').contentWindow;
|
|
console.log("---------->");
|
|
var elements = iframeDocument.getElementsByClassName('container-title');
|
|
var elements2 = iframeDocument.getElementsByClassName('.container-title');
|
|
console.log("---------->");
|
|
console.log(elements);
|
|
console.log(elements2);
|
|
console.log(iframeDocument);
|
|
}
|
|
</script>
|
|
</html>
|