External links are opened as blank tabs in new browser window in Chrome

31,436

Solution 1

As unfulvio said, the issue is with google-chrome.desktop, and it is missing the %U argument .

Open file: $HOME/.local/share/applications/google-chrome.desktop

Find the line:

Exec=/opt/google/chrome/chrome

Add a space and %U:

Exec=/opt/google/chrome/chrome %U

Then save the file.

Solution 2

I think I solved by removing this .desktop entry:

rm $HOME/.local/share/applications/google-chrome.desktop

which had the erroneous name New Tab - Google Chrome and was responsible for the new window/tab behavior described in my original question

I had to recreate the app icon after that, though

Share:
31,436

Related videos on Youtube

unfulvio
Author by

unfulvio

Updated on September 18, 2022

Comments

  • unfulvio
    unfulvio over 1 year

    Since I installed Ubuntu (fresh install on a new machine), and set Google Chrome as default browser, whenever I open links from external apps these are open as blank tabs in new browser window (no actual redirection to site, just a blank tab).

    I switched to Firefox and this behavior doesn't persist. If I switch back to Chrome as default browser (via default apps) it happens again.

    I noticed that both in Unity Launcher and from the default app settings, Chrome isn't called just 'Google Chome' but 'New Tab - Google Chrome'. Not sure if this is related or how to fix it. I made some searches that suggest to look for mimeapps.list or check that the google-chrome-stable.desktop contains a %U value, but none of these helped.

    This is an extract of the .desktop entry by the way:

    [Desktop Entry]
    Version=1.0
    Name=Google Chrome
    Exec=/usr/bin/google-chrome-stable %U
    Terminal=false
    Icon=google-chrome
    Type=Application
    Categories=Network;WebBrowser;
    MimeType=text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
    X-Ayatana-Desktop-Shortcuts=NewWindow;NewIncognito
    

    this is mimeapps.list

    [Default Applications]
    text/html=google-chrome.desktop
    x-scheme-handler/http=google-chrome.desktop
    x-scheme-handler/https=google-chrome.desktop
    x-scheme-handler/about=google-chrome.desktop
    x-scheme-handler/unknown=google-chrome.desktop
    
    • Nam G VU
      Nam G VU over 6 years
      I had the same issue and adding %U as the accepted answer below fix it for me.
  • LostNomad311
    LostNomad311 over 8 years
    Weird that you would fix your issue and then post an answer without the fix
  • unfulvio
    unfulvio over 8 years
    Ok, in my case the problem didn't solve with the answer you provided (which is still useful and had upvoted it). My problem solved by deleting the duplicate entry with the wrong name and I provided the command line to do exactly what I did. Probably a portion of the people who come across this will solve their issue with your fix, but some others, like me, might not and try deleting the .desktop entry. This is a bit old though and haven't seen the issue appearing anymore.
  • Dave
    Dave about 8 years
    I made this change and also changed the name to Google Chrome. Thanks.
  • Dave
    Dave about 8 years
    I was able to solve the problem without deleting the file. nomad311 posted a good partial solution, the name just needed to be cleaned up.
  • unfulvio
    unfulvio about 8 years
    due to popularity I switched the correct answer to @nomad311 - however anyone bumping into this unable to solve should consider my option too, it did the job for me
  • AlikElzin-kilaka
    AlikElzin-kilaka about 8 years
    Is there an open bug for chrome?
  • Krishna
    Krishna almost 8 years
    I just had to run this on Ubuntu 16.04 google-chrome Version 51.0.2704.63 - It's clearly not been fixed.
  • cfogelberg
    cfogelberg over 7 years
    This bug also affects WebStorm 2016.2.1 and the above fix to google-chrome.desktop resolves the issue there as well.
  • Vadim
    Vadim about 7 years
    It's still the case - March of 2017 here :( Nobody can fix this?
  • santhosh
    santhosh about 7 years
    use gedit to open a file to make the edit its working fine
  • Gui13
    Gui13 over 6 years
    I took the time to log in to upboat you, this saved my sanity. I had the same issue with the nightly version of Firefox which wouldn't open any clicked link, and it was driving me crazy.
  • Fractalf
    Fractalf over 6 years
    Thanks! Had the same problem here in Firefox Dev edition. Had to add the %u to ~/.local/share/applications/cinnamon-custom-launcher-1.deskt‌​op on Linux Mint 18.2
  • Alkarin
    Alkarin over 6 years
    This fixed the issue for me with firefox. Is there anywhere to find more info on these arguments?
  • LostNomad311
    LostNomad311 over 6 years
  • Akshay Paliwal
    Akshay Paliwal almost 6 years
    This worked for me on Ubuntu v16.04 and chrome v66
  • ONeZetty
    ONeZetty over 5 years
    Works perfect on Ubuntu 16.04 Unity Chrome Versión 70.0.3538.110 (Build oficial) unknown (64 bits)
  • Julian
    Julian over 5 years
    This is potentially still relevant on Ubuntu 18.10. I've just had to do it on 2018-12-05 after restoring my system after a catastrophic update (catastrophe my fault, I suspect).
  • maks
    maks about 5 years
    doesn't work on Ubuntu 18.04
  • tenken
    tenken almost 5 years
    Worked for me on Ubuntu 18.04
  • Riccardo
    Riccardo over 3 years
    OMG you just saved my life. Lots of love!
  • IgorAlves
    IgorAlves about 3 years
    I didn't have this line. I had to create it. Exec=/opt/google/chrome/chrome %U; at the end of the file.
  • karthik nair
    karthik nair over 2 years
    @unfulvio Thanks this fix worked
  • SL5net
    SL5net about 2 years
    i don't have ~/.local/share/applications/google-chrome.desktop in Kubuntu 20.04, KDE Plasma Version: 5.18.8