網頁喚起App & 複製網頁內容到移動端剪下板
阿新 • • 發佈:2021-12-08
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <script src="https://unpkg.com/callapp-lib"></script> <script src="https://unpkg.com/clipboard@2/dist/clipboard.min.js"></script> </head> <body> <div> <h3>網頁喚起App</h3> <button onclick="ceshi();">callapp-lib 喚起App</button> </div> <div> <h3>複製文字到剪下板</h3> <!-- Target --> <textarea id="bar">Mussum ipsum cacilds...</textarea> <!-- Trigger --> <button class="btn" data-clipboard-target="#bar"> Copy to clipboard </button> </div> <script> newClipboardJS(".btn"); // zhihu://question/27883599 const option = { scheme: { protocol: "zhihu", }, fallback: "https://oia.zhihu.com/", timeout: 4000, }; const lib = new CallApp(option); function ceshi() { lib.open({ path: "question/27883599" }); } </script> </body> </html>