Skip to content

Commit

Permalink
fix iOS13 #7
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmmc committed Nov 19, 2019
1 parent c04d8f8 commit 66cec80
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ async function main() {
httpServer.listen(8080, function() {
console.log(`
----------------------------------------
Version 1.8 by hjmmc
Version 1.9 by hjmmc
-----------------------------------------
##Usage
Expand Down
21 changes: 18 additions & 3 deletions static.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
</head>

<body>
<p>Version: 1.8 (by <a href="https://github.com/hjmmc/WebGyroForCemuhook/releases">hjmmc</a>)</p>
<p>Version: 1.9 (by <a href="https://github.com/hjmmc/WebGyroForCemuhook/releases">hjmmc</a>)</p>
<p>Tips:Please keep the screen bright when you use it.</p>
<p>Notice: If you are using <span style="color: red;">ios 12.2+</span>, please enable 'Settings > Safari > Motion and Orientation access' and use HTTPS to access
<a style="color: blue" onclick="window.location.href='https://'+window.location.hostname+':8443'">this page</a></p>


<p>If you are using iOS 13+, please click <button onclick="requestPermission()">allow permission</button></p>
<p>
Use <a href="https://xip.lhjmmc.cn">xip.lhjmmc.cn</a> https cert to slove latency problem.
<span style="font-size: 10px;color:#999;text-decoration:line-through;">Since safari's websocket does not support self-signed certificates, when using HTTPS access, socket.io will probably use XHR instead of websocket, which will increase communication latency.</span>
Expand All @@ -46,6 +45,22 @@
</body>

<script>
function requestPermission(){
if(window.DeviceMotionEvent&&window.DeviceMotionEvent.requestPermission){
window.DeviceMotionEvent.requestPermission().then(function(response) {
if (response === 'granted') {
// permission granted
} else {
// permission not granted
alert('permission not granted!')
}
},function(err){
alert(err)
})
}
}


if(window.location.protocol==='https:'&&window.location.hostname.indexOf('xip.lhjmmc.cn')===-1){
alert('Please access https by https://x-x-x-x.xip.lhjmmc.cn:8443')
}
Expand Down

0 comments on commit 66cec80

Please sign in to comment.