问HN:是否有可能绕过捕获门户网页视图的限制?

1作者: remohexa4 个月前原帖
我建立了一个完全依赖于树莓派热点的本地媒体共享网站。主要思路是利用Android的强制门户机制。 当Android设备连接到网络时,它会检查一个特定的URL(connectivitycheck.gstatic.com/generate_204)。如果响应是204,它不会触发任何操作,但如果收到其他响应(如302),它会在一个沙盒化的网页视图中打开该页面,并在存在“Location”头的情况下跟随该头。 我使用dnsmasq伪造了该URL并返回所需的响应代码。令我惊讶的是,这确实有效,但我才发现强制门户默认是沙盒化的。整个网站按预期工作,唯一缺失的功能是我无法选择任何类型的文件。 我很好奇这里有没有人之前尝试过强制门户。有没有办法打开用户的浏览器?我觉得如果我提示他们打开一个URL在浏览器中,可能会失去用户的兴趣。
查看原文
I built a local media sharing website that runs entirely on a Pi hotspot. The main idea was to rely on Android&#x27;s captive portal mechanism.<p>When an Android device connects to a network, it checks a specific URL (connectivitycheck.gstatic.com&#x2F;generate_204). If the response is 204, it won&#x27;t trigger anything, but if it receives something else (like 302), it will open that page inside a sandboxed webview and follow the &quot;Location&quot; header if it is present.<p>I used dnsmasq to spoof that URL and return the required response code. To my surprise, it actually worked, but only then did I discover that captive portals are sandboxed by default. The whole website is working as it should, with the only missing feature being that I can&#x27;t select any type of files.<p>I&#x27;m curious if anyone here has ever experimented with captive portals before. Is there any way to open the user&#x27;s browser? I feel like I might lose the user interest if I prompt them with a url to open in their browser.