用 web 模拟桌面,感觉这个思路很有意思,但是想了想好像也没啥用

查看 25|回复 2
作者:meeop   
如下链接复制到浏览器地址栏可以看看示例效果
以前有一阵流行云桌面,现在都搜不到了,我在想以 pc 桌面的交互方式展示一般 web 服务,有啥有用的场景吗?
data:text/html;base64,PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KCjxoZWFkPgogICAgPG1ldGEgY2hhcnNldD0iVVRGLTgiPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0xLjAiPgogICAgPHRpdGxlPkRlc2t0b3AgU2ltdWxhdGlvbjwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgYm9keSB7CiAgICAgICAgICAgIGZvbnQtZmFtaWx5OiBBcmlhbCwgc2Fucy1zZXJpZjsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2YwZjBmMDsKICAgICAgICAgICAgbWFyZ2luOiAwOwogICAgICAgICAgICBvdmVyZmxvdzogYXV0bzsKICAgICAgICAgICAgd2lkdGg6IDEwMHZ3OwogICAgICAgICAgICBoZWlnaHQ6IDEwMHZoOwogICAgICAgIH0KCiAgICAgICAgI2Rlc2t0b3AgewogICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgIHdpZHRoOiAxMDAwJTsKICAgICAgICAgICAgaGVpZ2h0OiAxMDAwJTsKICAgICAgICAgICAgcGFkZGluZzogMjBweDsKICAgICAgICB9CgogICAgICAgIC5zaG9ydGN1dCB7CiAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgY3Vyc29yOiBwb2ludGVyOwogICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmOwogICAgICAgICAgICBwYWRkaW5nOiAxMHB4OwogICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZCAjY2NjOwogICAgICAgICAgICBib3JkZXItcmFkaXVzOiA1cHg7CiAgICAgICAgICAgIGJveC1zaGFkb3c6IDAgMnB4IDVweCByZ2JhKDAsIDAsIDAsIDAuMSk7CiAgICAgICAgfQoKICAgICAgICAud2luZG93IHsKICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICB3aWR0aDogNTB2dzsKCiAgICAgICAgICAgIGhlaWdodDogNTB2aDsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsKICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQgI2NjYzsKICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNXB4OwogICAgICAgICAgICBib3gtc2hhZG93OiAwIDJweCA1cHggcmdiYSgwLCAwLCAwLCAwLjMpOwogICAgICAgICAgICB6LWluZGV4OiAxMDA7CiAgICAgICAgfQoKICAgICAgICAud2luZG93LXRpdGxlYmFyIHsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2YwZjBmMDsKICAgICAgICAgICAgcGFkZGluZzogOHB4OwogICAgICAgICAgICBib3JkZXItYm90dG9tOiAxcHggc29saWQgI2NjYzsKICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNXB4IDVweCAwIDA7CiAgICAgICAgICAgIGN1cnNvcjogbW92ZTsKICAgICAgICB9CgogICAgICAgIC50aXRsZSB7CiAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiBib2xkOwogICAgICAgIH0KCiAgICAgICAgLmNsb3NlLWJ0biB7CiAgICAgICAgICAgIGZsb2F0OiByaWdodDsKICAgICAgICAgICAgYm9yZGVyOiBub25lOwogICAgICAgICAgICBiYWNrZ3JvdW5kOiBub25lOwogICAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7CiAgICAgICAgfQoKICAgICAgICAud2luZG93LWNvbnRlbnQgewogICAgICAgICAgICBwYWRkaW5nOiAxMHB4OwogICAgICAgICAgICBoZWlnaHQ6IGNhbGMoMTAwJSAtIDMwcHgpOwogICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgIH0KCiAgICAgICAgLmlmcmFtZS1jb250YWluZXIgewogICAgICAgICAgICBoZWlnaHQ6IGNhbGMoMTAwJSAtIDMwcHgpOwogICAgICAgIH0KCiAgICAgICAgLmlmcmFtZS1jb250YWluZXIgaWZyYW1lIHsKICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgIGhlaWdodDogMTAwJTsKICAgICAgICAgICAgYm9yZGVyOiBub25lOwogICAgICAgIH0KCiAgICAgICAgLnJlc2l6ZS1oYW5kbGUgewogICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgIHdpZHRoOiAxMHB4OwogICAgICAgICAgICBoZWlnaHQ6IDEwcHg7CiAgICAgICAgICAgIGJvdHRvbTogMDsKICAgICAgICAgICAgcmlnaHQ6IDA7CiAgICAgICAgICAgIGN1cnNvcjogbndzZS1yZXNpemU7CiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNjY2M7CiAgICAgICAgfQogICAgPC9zdHlsZT4KPC9oZWFkPgoKPGJvZHk+CiAgICA8ZGl2IGlkPSJkZXNrdG9wIj4KICAgICAgICA8ZGl2IGNsYXNzPSJzaG9ydGN1dCIgaWQ9ImNyZWF0ZVdpbmRvd0J0biIgc3R5bGU9ImxlZnQ6IDIwMHB4OyB0b3A6IDMwcHg7Ij4KICAgICAgICAgICAg54K55Ye75Yib5bu65rWP6KeI5Zmo56qX5Y+jCiAgICAgICAgPC9kaXY+CiAgICAgICAgPGRpdj4KICAgICAgICAgICAgPGJ1dHRvbiBvbmNsaWNrPSdjcmVhdGVCcm93c2VyV2luZG93KCJodHRwczovL2N0b29sLmRldi90b29sLmh0bWwjL3Rvb2wvanNvbj9jYXRlZ29yeT1jb252ZXJzaW9uIiknPmpzb25FZGl0PC9idXR0b24+PGJyPgogICAgICAgIDwvZGl2PgogICAgPC9kaXY+CgogICAgPHNjcmlwdD4KICAgICAgICBsZXQgekluZGV4ID0gMTsgCgogICAgICAgIAogICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdjcmVhdGVXaW5kb3dCdG4nKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsICgpID0+IHsKICAgICAgICAgICAgY3JlYXRlQnJvd3NlcldpbmRvdygpOwogICAgICAgIH0pOwoKICAgICAgICAKICAgICAgICBmdW5jdGlvbiBjbG9zZVdpbmRvdyh3aW5kb3dJZCkgewogICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCh3aW5kb3dJZCkucmVtb3ZlKCk7CiAgICAgICAgfQoKICAgICAgICAKICAgICAgICBmdW5jdGlvbiBkcmFnV2luZG93KHdpbmRvd0lkLCBldmVudCkgewogICAgICAgICAgICBjb25zdCB3aW5kb3dFbGVtID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQod2luZG93SWQpOwogICAgICAgICAgICB3aW5kb3dFbGVtLnN0eWxlLnpJbmRleCA9ICsrekluZGV4OyAKICAgICAgICAgICAgbGV0IHBvc1ggPSBldmVudC5jbGllbnRYOwogICAgICAgICAgICBsZXQgcG9zWSA9IGV2ZW50LmNsaWVudFk7CiAgICAgICAgICAgIGxldCB3aW5kb3dMZWZ0ID0gd2luZG93RWxlbS5vZmZzZXRMZWZ0OwogICAgICAgICAgICBsZXQgd2luZG93VG9wID0gd2luZG93RWxlbS5vZmZzZXRUb3A7CgogICAgICAgICAgICBmdW5jdGlvbiBtb3ZlV2luZG93KGV2ZW50KSB7CiAgICAgICAgICAgICAgICBsZXQgZHggPSBldmVudC5jbGllbnRYIC0gcG9zWDsKICAgICAgICAgICAgICAgIGxldCBkeSA9IGV2ZW50LmNsaWVudFkgLSBwb3NZOwogICAgICAgICAgICAgICAgd2luZG93RWxlbS5zdHlsZS5sZWZ0ID0gd2luZG93TGVmdCArIGR4ICsgJ3B4JzsKICAgICAgICAgICAgICAgIHdpbmRvd0VsZW0uc3R5bGUudG9wID0gd2luZG93VG9wICsgZHkgKyAncHgnOwogICAgICAgICAgICB9CgogICAgICAgICAgICBmdW5jdGlvbiBzdG9wTW92ZSgpIHsKICAgICAgICAgICAgICAgIGRvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ21vdXNlbW92ZScsIG1vdmVXaW5kb3cpOwogICAgICAgICAgICAgICAgZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignbW91c2V1cCcsIHN0b3BNb3ZlKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJywgbW92ZVdpbmRvdyk7CiAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNldXAnLCBzdG9wTW92ZSk7CiAgICAgICAgfQoKICAgICAgICAKICAgICAgICBmdW5jdGlvbiBjcmVhdGVCcm93c2VyV2luZG93KHVybCkgewogICAgICAgICAgICBjb25zdCB3aW5kb3dJZCA9IGB3aW5kb3cke3pJbmRleH1gOwogICAgICAgICAgICBjb25zdCBpZnJhbWVJZCA9IGBpZnJhbWUke3pJbmRleH1gOwoKICAgICAgICAgICAgY29uc3QgbmV3V2luZG93ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7CiAgICAgICAgICAgIG5ld1dpbmRvdy5pZCA9IHdpbmRvd0lkOwogICAgICAgICAgICBuZXdXaW5kb3cuY2xhc3NOYW1lID0gJ3dpbmRvdyc7CiAgICAgICAgICAgIG5ld1dpbmRvdy5zdHlsZS5sZWZ0ID0gJzEwMHB4JzsgCiAgICAgICAgICAgIG5ld1dpbmRvdy5zdHlsZS50b3AgPSAnMTAwcHgnOyAKICAgICAgICAgICAgbmV3V2luZG93LnN0eWxlLnpJbmRleCA9ICsrekluZGV4OyAKICAgICAgICAgICAgbmV3V2luZG93LmlubmVySFRNTCA9IGAKICAgICAgICAgICAgPGRpdiBjbGFzcz0id2luZG93LXRpdGxlYmFyIiBvbm1vdXNlZG93bj0iZHJhZ1dpbmRvdygnJHt3aW5kb3dJZH0nLCBldmVudCkiPgogICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9InRpdGxlIj7mtY/op4jlmajnqpflj6M8L3NwYW4+CiAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPSJjbG9zZS1idG4iIG9uY2xpY2s9ImNsb3NlV2luZG93KCcke3dpbmRvd0lkfScpIj5YPC9idXR0b24+CiAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICA8ZGl2IGNsYXNzPSJ3aW5kb3ctY29udGVudCI+CiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJpZnJhbWUtY29udGFpbmVyIj4KICAgICAgICAgICAgICAgICAgICA8aWZyYW1lIGlkPSIke2lmcmFtZUlkfSIgc3JjPSIiPjwvaWZyYW1lPgogICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICA8ZGl2IGNsYXNzPSJyZXNpemUtaGFuZGxlIiBvbm1vdXNlZG93bj0ic3RhcnRSZXNpemUoZXZlbnQpIj48L2Rpdj4KICAgICAgICBgOwogICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKG5ld1dpbmRvdyk7CgogICAgICAgICAgICAKICAgICAgICAgICAgY29uc3QgaWZyYW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoaWZyYW1lSWQpOwogICAgICAgICAgICBpZiAodXJsKSB7CiAgICAgICAgICAgICAgICBpZnJhbWUuc3JjID0gdXJsOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgY29uc3QgaW5wdXRVcmwgPSBwcm9tcHQoJ+ivt+i+k+WFpee9keWdgO+8micsICdodHRwczovLycpOwogICAgICAgICAgICAgICAgaWYgKGlucHV0VXJsKSB7CiAgICAgICAgICAgICAgICAgICAgaWZyYW1lLnNyYyA9IGlucHV0VXJsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgIH0KCiAgICAgICAgCiAgICAgICAgZnVuY3Rpb24gc3RhcnRSZXNpemUoZXZlbnQpIHsKICAgICAgICAgICAgY29uc3QgcmVzaXplSGFuZGxlID0gZXZlbnQudGFyZ2V0OwogICAgICAgICAgICBjb25zdCB3aW5kb3dFbGVtID0gcmVzaXplSGFuZGxlLnBhcmVudEVsZW1lbnQ7CiAgICAgICAgICAgIGNvbnN0IGlmcmFtZUNvbnRhaW5lciA9IHdpbmRvd0VsZW0ucXVlcnlTZWxlY3RvcignLmlmcmFtZS1jb250YWluZXInKTsKICAgICAgICAgICAgY29uc3QgaWZyYW1lID0gaWZyYW1lQ29udGFpbmVyLnF1ZXJ5U2VsZWN0b3IoJ2lmcmFtZScpOwogICAgICAgICAgICBsZXQgc3RhcnRYID0gZXZlbnQuY2xpZW50WDsKICAgICAgICAgICAgbGV0IHN0YXJ0WSA9IGV2ZW50LmNsaWVudFk7CiAgICAgICAgICAgIGxldCBzdGFydFdpZHRoID0gd2luZG93RWxlbS5vZmZzZXRXaWR0aDsKICAgICAgICAgICAgbGV0IHN0YXJ0SGVpZ2h0ID0gd2luZG93RWxlbS5vZmZzZXRIZWlnaHQ7CgogICAgICAgICAgICBmdW5jdGlvbiByZXNpemVXaW5kb3coZXZlbnQpIHsKICAgICAgICAgICAgICAgIGxldCBkeCA9IGV2ZW50LmNsaWVudFggLSBzdGFydFg7CiAgICAgICAgICAgICAgICBsZXQgZHkgPSBldmVudC5jbGllbnRZIC0gc3RhcnRZOwogICAgICAgICAgICAgICAgbGV0IG5ld1dpZHRoID0gc3RhcnRXaWR0aCArIGR4OwogICAgICAgICAgICAgICAgbGV0IG5ld0hlaWdodCA9IHN0YXJ0SGVpZ2h0ICsgZHk7CgogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICB3aW5kb3dFbGVtLnN0eWxlLndpZHRoID0gbmV3V2lkdGggKyAncHgnOwogICAgICAgICAgICAgICAgd2luZG93RWxlbS5zdHlsZS5oZWlnaHQgPSBuZXdIZWlnaHQgKyAncHgnOwogICAgICAgICAgICAgICAgaWZyYW1lQ29udGFpbmVyLnN0eWxlLmhlaWdodCA9IGBjYWxjKDEwMCUgLSAke3dpbmRvd0VsZW0ucXVlcnlTZWxlY3RvcignLndpbmRvdy10aXRsZWJhcicpLm9mZnNldEhlaWdodH1weClgOwogICAgICAgICAgICB9CgogICAgICAgICAgICBmdW5jdGlvbiBzdG9wUmVzaXplKCkgewogICAgICAgICAgICAgICAgZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJywgcmVzaXplV2luZG93KTsKICAgICAgICAgICAgICAgIGRvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ21vdXNldXAnLCBzdG9wUmVzaXplKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJywgcmVzaXplV2luZG93KTsKICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW91c2V1cCcsIHN0b3BSZXNpemUpOwogICAgICAgIH0KICAgIDwvc2NyaXB0Pgo8L2JvZHk+Cgo8L2h0bWw+
webbillion   
没用但有意思,不是还有 jslinux 么
leconio   
群晖主页
您需要登录后才可以回帖 登录 | 立即注册

返回顶部