Apache2 Ubuntu Navigator缺少功能

发布于 2025-01-26 08:46:29 字数 729 浏览 4 评论 0原文

我一直在开发带有Apache2的Web应用程序,该应用程序最终应该在Raspberry Pi上运行。

最初的开发和测试是在Arch Linux机器(带有HTTPD)上进行的,然后在PI上转移并进一步调试。

最近,我已经开始使用JavaScript和Navigator.getGamePads()函数将控制器输入到Web应用中。所有在我的拱机上的预期工作,但是当我将代码传输到PI时,我会收到“ Navigator.getGamePads”不是函数的错误。

在进行进一步调查时,我确实可以确认使用Firefox JavaScript控制台缺少该功能,并且Navigator对象本身在两个页面(Arch版本和PI版本)中看起来完全不同。

PI Navigator: https://i.sstatic.net/run6u.png

Arch Navigator Arch Navigator: https://i.sstatic.net/erbxt.png

两个屏幕截图均在同一个屏幕上拍摄机器,同一浏览器,页面从两个位置加载在不同的选项卡中。

有人遇到过类似的问题吗?

I've been developing a web app with Apache2 which is supposed to run on a Raspberry pi running Ubuntu in the end.

Initial developing and testing is done on an Arch Linux machine (with httpd) and then transferred and further debugged on the pi.

Recently, I've started implementing controller input into the web app using javascript and the navigator.getGamepads() function. Everything working as expected on my Arch machine, but when i transfer the code to the pi, i get a "navigator.getGamepads is not a function" error.

When further investigating, I can indeed confirm that the function is missing using the firefox javascript console, as well as that the navigator object itself looks quite different for both pages (the Arch version, and the pi version).

Pi navigator:
https://i.sstatic.net/RUN6U.png

Arch navigator:
https://i.sstatic.net/ERBxT.png

Both screenshots are taken on the same machine, same browser, with the page loaded from both places in different tabs.

Has anyone experienced similar problem, and is there a fix?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

著墨染雨君画夕 2025-02-02 08:46:29

修补后找到答案。

事实证明,除非通过SSL(HTTPS)处理连接,否则浏览器(Firefox)不会公开所有导航器功能。

Found an answer after some tinkering.

Turns out the browser (Firefox) will not expose all navigator functions unless the connection is handled through SSL (https).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文