Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

libai / footsen

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • footsen
  • footseen
  • share
  • demo.html
Find file
BlameHistoryPermalink
  • dabai's avatar
    footseen h5 移植 · 6161a8cd
    dabai committed 4 years ago
    6161a8cd
demo.html 954 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!-- a标签点击打开的动作,在click事件中注册 -->
<a href="javascript:;" id="openApp">firefly</a>
</body>

<script type="text/javascript">
    document.getElementById('openApp').onclick = function(e){
        // 通过iframe的方式试图打开APP,如果能正常打开,会直接切换到APP,并自动阻止js其他行为

        var ifr = document.createElement('iframe');
        ifr.src = 'mitaolive:/';//打开app的协议,有app同事提供
        ifr.style.display = 'none';
        document.body.appendChild(ifr);
        window.setTimeout(function(){
            document.body.removeChild(ifr);
            window.location.href = "itms-services://?action=download-manifest&url=https://app.ixiulive.com/mitaozhibo-resigned.plist";//打开app下载地址,有app同事提供
        },2000)
    };
</script>
</html>