Original: https://blog.csdn.net/qna17/article/details/110469846
Solution:
1. Open Registry Editor, click to enter the start menu, then enter [regedit], click to enter the upper [Registry Editor]
and then enter the registry editor, as shown in the figure:
2. Click on the HKEY_CLASSES_ROOT folder, Find the .js folder.
3. Double-click Content Type and change text/plain to text/javascript.
4. Then close the pgadmin service (right-click and select Shut down server), then reopen pgadmin4, and enter successfully.