按照以下步骤解决此问题:
PGAdmin一直在跟踪漏洞 5996。他们推荐以下解决方案:
他们还提到:You can add the following lines to the "config_distro.py" and restart the pgAdmin 4 server:
import mimetypes mimetypes.add_type('text/javascript', '.js')
The above workaround should work for you.
config_distro.py
可以在随后的升级中被覆盖。
pgAdmin 还提供了另一种选项,可以在 config_system.py 文件中设置设置,该文件旨在供系统管理员包括设置,并且在 pgAdmin 安装之外。请参阅 https://www.pgadmin.org/docs/pgadmin4/4.28/config_py.html 以获取更多详细信息。
另一个回答中有评论问是什么导致了这个问题/作者是如何找出来的。
为了后人,这在FAQ中有记录:
当我在Windows上启动pgAdmin 4 v4.28或更高版本时,加载页面永远不会关闭。为什么?
pgAdmin 4 v4.28包括额外的安全功能,其中之一旨在防止由内容嗅探引起的安全问题。
不幸的是,某些Windows系统被错误配置,这会导致pgAdmin使用的Javascript无法加载。在浏览器上打开开发者工具将显示类似于以下错误:
> Refused to execute script from
> 'http://127.0.0.1:57313/static/vendor/require/require.min.js?ver=42800'
> because its MIME type ('text/plain') is not executable, and strict
> MIME type checking is enabled.
>
> (index):39 Uncaught ReferenceError: require is not defined at
> (index):39
config_distro.py
中包含额外的行来使 4.29 正常工作,而无需修改注册表。 - Lynn Crumbling2022年5月25日编辑(pgadmin4下载新链接)
你们都给出了很好的答案……但是根据我的经验,最简单的方法是安装新版本的pgadmin4,无需卸载现有版本。
这就是我所做的,我能够仍然看到所有未改变和未被篡改的数据库和表格。
只需运行安装程序,你就可以开始使用了。
pgadmin4-3.6
。它在Windows 10(x64)上运行良好。我在使用Chrome浏览器和Windows 10操作系统时,也遇到了pgAdmin 4.28的同样问题。但是当我切换到Edge浏览器后,问题得到了解决。