pgAdmin 4 always open in browser not as a standalone desktop application

前端 未结 6 1652
梦毁少年i
梦毁少年i 2020-12-07 14:32

installed PSQL10 but when pgAdmin is run from start then always open in browser.There is no option to run as a Desktop Application

6条回答
  •  醉酒成梦
    2020-12-07 15:24

    The solution I use on my MacBook (running Mojave) is based on @Andrej's answer and the associated comments. It's not perfect, but gets me most of what I need.

    First, install pgAdmin. I use Homebrew:

    $ brew cask install pgadmin4
    

    Start pgAdmin from the Applications menu.

    This gives you an elephant-looking icon in the top menu bar. In there, select Configure... and change the Browser Command to:

    "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --app %URL%
    

    Check the checkbox for Fixed Port Number and choose an arbitrary port (I used 20000), and click OK.

    Next, open a new browser window off the elephant menu using New pgAdmin 4 window. You may need to enter a passphrase to protect your database credentials.

    When the window has opened, go Chrome's 3-dots menu on the right-hand side of the window, and choose More Tools > Create Shortcut. Make sure you check the checkbox to use a separate window.

    Chrome will create a shortcut that pops up pgAdmin in a separate window with its own icon, and you can pin this window to the dock. If you forget to pin the shortcut to the dock, you can find it again at chrome://apps/.

    Unfortunately, this shortcut doesn't automatically start pgAdmin and doesn't inherit the security context that you get when you use the New pgAdmin 4 window from the elephant menu. So, after a reboot or after quitting Chrome, you'll get an error like this:

    Unauthorized The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.

    The fix is to start pgAdmin from the Applications menu and open a new window with New pgAdmin 4 window. After that, you can refresh your standalone window with ⌘-R, and then you can close the other browser window.

    This is a little annoying, but it at least gets me a separate icon and window, which is what I mostly care about.

提交回复
热议问题