开启辅助访问     
收藏本站

站内搜索

搜索

Minecraft(我的世界)苦力怕论坛

[其他] 在某些应用的内置浏览器中浏览任意网页

 发表于 2024-6-6 08:40:58 来自手机|显示全部楼层|阅读模式 IP:广西
本帖最后由 小永高呐 于 2024-6-6 08:49 编辑

在后台创建一个叫index.html的网页,粘贴如下代码入内保存,之后在可以打开网址的应用输入你主机的网址(或者用我这的demo也行),就可以去浏览任意网页了
蛮早之前码的代码,蛮乱的,不过能用,也没啥依赖项
演示demo:https://pic-tc.pages.dev/xiaoyonggaoya/website

  1. <html>
  2. <head>
  3. <title>网页浏览器</title>
  4. <style>
  5. body{margin:0;padding:0}
  6. #misha {position: fixed;top: 10px;right: 10px;width: 80px;height: 40px;background-color: #88888899;border: none;font-size: 20px;border-radius:8px;} /* 打开菜单按钮 */
  7. #liuying {position: fixed;top: 60px;right: 10px;width: 300px;height: 230px;background-color: #ffffff99;border: 1px solid black;display: none;border-radius:4px;} /* 界面 */
  8. #hanya {margin: 10px;width: 280px;border-radius:3px;} /* 网址栏 */
  9. #tingyun {margin: 10px;width: 80px;height: 40px;background-color: #00FF9999;border: none;border-radius:8px;} /* 访问/刷新按钮 */
  10. #zhigengniao {margin: 10px;width: 80px;height: 40px;background-color: #FF000099;border: none;border-radius:8px;} /* 关闭菜单按钮 */
  11. #iframe {width: 100%;height: 100%;border: none;} /* iframe自适应全屏 */
  12. div {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}
  13. button {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}
  14. </style>
  15. <base target="_self">
  16. </head>
  17. <body>
  18. <button id="misha" onclick="tuopa()">菜单</button>
  19. <div id="liuying">
  20. <div>请在下面框中输入网址以访问网站</div>
  21. <input id="hanya" type="text" placeholder="输入网址以访问网站" value="https://www.bing.com">
  22. <button id="tingyun" onclick="guinaifen()">访问/刷新</button>
  23. <button id="zhigengniao" onclick="buruoniya()">关闭菜单</button>
  24. </div>
  25. <iframe id="iframe" src="https://www.bing.com" allow="fullscreen" allowfullscreen="true"></iframe>
  26. <script>
  27. function tuopa() {document.getElementById("liuying").style.display = "block";} // 菜单打开
  28. function buruoniya() {document.getElementById("liuying").style.display = "none";} // 菜单关闭
  29. function guinaifen() {var url = document.getElementById("hanya").value;document.getElementById("iframe").src = url;} // 网址访问/刷新
  30. window.onload = function() {tuopa();} // 让页面加载时展开菜单
  31. </script>
  32. </body>
  33. </html>
复制代码
苦力怕论坛,感谢有您~
 发表于 2024-6-6 08:50:14 来自手机|显示全部楼层 IP:湖南省
本帖最后由 一只晨月鸭 于 2024-6-6 13:38 编辑

方法不错,就是访问的时候比例不太对
这里我提醒一句
这样可能会动了某些人的蛋糕
某些付费防红的短链接就是这种方法访问的
2#2024-6-6 08:50:14回复收起回复
苦力怕论坛,感谢有您~
回复支持

使用道具举报

 发表于 2024-6-6 10:17:58 来自手机|显示全部楼层 IP:贵州省
手机访问很难受,建议把下面这个代码加入
  1. <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
复制代码

我加了这行可以看看(点击查看)
3#2024-6-6 10:17:58回复收起回复
苦力怕论坛,感谢有您~
回复支持

使用道具举报

本版积分规则

本站
关于我们
联系我们
坛史纲要
官方
哔哩哔哩
技术博客
下载
网易版
安卓版
JAVA
反馈
意见建议
教程中心
更多
捐助本站
QQ群
QQ群

QQ群

访问手机版

访问手机版

手机版|小黑屋|系统状态|klpbbs.com

粤公网安备 44200002445329号 | 由 木韩网络 提供云服务 | GMT+8, 2024-9-1 06:51

声明:本站与Mojang以及微软公司没有从属关系

Powered by Discuz! X3.4 粤ICP备2023071842号