protonscr

steam:// links from Firefox open Steam client to main page but do not initiate download/install

steamclosed Steam clientValve-provided steam package
ValveSoftware/steam-for-linux#6942 · opened 2020-03-02 by codingthat · updated 2020-04-17 · 31 comments · github
Ccodingthat 2020-03-02 github

Your system information

  • Steam client version (build number or date): Feb 11 2020 (latest, according to trying to update)
  • Distribution (e.g. Ubuntu): Linux Mint 19
  • Opted into Steam client beta?: [Yes/No] No
  • Have you checked for system updates?: [Yes/No] Yes

Please describe your issue in as much detail as possible:

This is the first time I remember trying a steam:// link from the browser, and it didn't download the game, even though the button is labelled "Download."

Steps for reproducing this issue:

  1. Go to https://store.steampowered.com/app/1016770/Interrogation_You_will_be_deceived/ in Firefox
  2. Click "Download" there
  3. Yes, I have Steam installed (opened a steam:// URL)
  4. Steam opens, but doesn't initiate a download, as I'd expected, nor bring me to the game's store page, as I would've expected in lieu of the download actually starting
Kkisak-valve maintainer 2020-03-02 github

Steps to reproduce can be simplified to running steam steam://install/1224950 in a terminal.

Ccodingthat 2020-03-02 github

@kisak-valve Not so, but thank you for mentioning it: Running that in a terminal actually worked—I got a Steam dialog box asking me where to download. I hit Cancel for now, followed the steps above, and still the Download button does nothing. So:

  1. the steps to reproduce are still accurate
  2. terminal's a good workaround
  3. the possibly separate issue of steam:// links not opening to anything in particular when launched from a browser is even more unexpected given that the equivalent works from the command line

I mentioned the steam:// thing in the original description since I've never had it happen before that a download button didn't work from within the Steam client, and I've also rarely (if ever) used a steam:// link from my browser, so I thought it might not be a coincidence that the first time I tried a steam:// link, it broke something.

However, if we are sure this is a coincidence, I will open a separate issue about launching from the browser. I'm not sure we can confidently say that though until the main issue of the Steam client download button not working is solved.

Just now, I tried another game, https://store.steampowered.com/app/728100/DECEIVER/ , steam link steam://install/819580 , and it does the same thing: Opens the Steam client but just to the front store page, not the particular game, and not downloading it. And again the workaround here works: steam steam://install/819580 in a Terminal opens the Steam client and opens a subwindow ready to start the download.

Kkisak-valve maintainer 2020-03-02 github

My understanding is that Firefox should be calling the desktop environment's MIME handler, which in turn should be calling steam steam://install/<appid> to hand it off to Steam. Since the latter is working from the terminal, than there's an issue outside of Steam.

Are you using the Valve-provided Steam package or the Distro-provided Steam package and what version is it? Also, what desktop environment are you using?

Ccodingthat 2020-03-02 github

OK, then I should open a separate issue about that, right? Because independent of the browser, I cannot open the Steam client and download a game. The only method working right now is from the terminal.

Meanwhile, pretty sure it's Valve-provided: Synaptic Package Manager says it's from repo.steampowered.com so I imagine I downloaded it initially directly rather than via the distro software manager. Version is 1.0.0.61 according to Synaptic. (I'm not sure how the package versioning interacts with the Steam client's own auto-updater, though.) Desktop environment is MATE 1.20.1.

Ccodingthat 2020-03-02 github

OK you seem to want to focus on the browser issue here, so I'll open a new issue for the Steam client problem then.

Kkisak-valve maintainer 2020-03-02 github

Before you do that, please opt into Steam's beta client and retest.

Ccodingthat 2020-03-02 github

Ah OK will do

Ccodingthat 2020-03-03 github

@kisak-valve Following the above steps after enabling the beta client, letting it download, install, and restart, the link from Firefox still behaves exactly the same. So the beta is also broken in this regard on my system.

?ghost 2020-03-05 github

I know that I can do this successfully from latest Firefox and Steam on Fedora 31 as I use it to work around the broken download button in Steam application store pages.

The easiest test is to do this with some other application and see if it works or not. Obviously, if it didn't work then as well, it could hardly be Valve's problem for Steam client and you could move on.

Ccodingthat 2020-03-05 github

@byte1024 Good point on the test, so I went and found a mailto: link at https://www.scottseverance.us/mailto.html and those work fine, even with extended attributes like subject and body. So it's able to open the handler and pass values to it.

Ccodingthat 2020-03-05 github

That being the case, maybe it's not the Steam client itself, but the Steam package that installed the MIME handler that maybe did it incorrectly. I'm not sure how they work though.

?ghost 2020-03-07 github

That being the case, maybe it's not the Steam client itself, but the Steam package that installed the MIME handler that maybe did it incorrectly. I'm not sure how they work though.

I only noticed now that you used a non-distro provided one. So yes, I would assume it would work if you used the distro provided one or if Valve can find a way to fix the others.

But, I don't know either. Haven't coded any of that before.

Ccodingthat 2020-03-08 github

@byte1024 If I recall correctly, I initially had tried the distro-provided package, and run into trouble. As even recent comments in the OS-provided Software Manager suggest, the direct .deb from Steam is likely to work better, which it had for me at the time.

I would in theory try switching back, but I'm not sure I'm willing to risk having to redownload/reinstall my games library. I'm hoping Valve can support the Valve-supplied package...

?ghost 2020-03-09 github

Agreed, it would be nice if any package used would have working links and to not have to deal with the risk of switching :+1:

TTTimo 2020-03-09 github

You mentioned that steam opens though, so whatever MIME configuration you ended up with is at least running steam - but something is different in the command line or environment causing the 'go to download' feature to fail then?

TTTimo 2020-03-09 github

Nevermind, looks like your problem was https://github.com/ValveSoftware/steam-for-linux/issues/6943 and the URL opening was working fine all along.

Ccodingthat 2020-03-10 github

@TTimo I'm not sure why you closed this. This turned out to be two separate issues. #6943 was solved by opting in (and then stayed solved after opting out, for whatever reason) to the Steam client beta. Whereas this current issue is still an issue for me. Clicking a steam:// link in Firefox opens the Steam client but does not go to the game's page nor begin a download, and opting into or out of the Steam beta did not solve anything like it solved the other issue.

In fact, I have a further update, I noticed that if the Steam client is already open, clicking a steam:// link in Firefox causes the Steam client to revert to the main store page if I had already navigated somewhere else prior. I'm not sure if that details helps anything, but there it is.

Kkisak-valve maintainer 2020-03-10 github

I've got a hunch that your system is configured to MIME call steam:// with steam steam://store instead of the normal /usr/bin/steam %U, but I don't know off hand where this is configured on your system. Maybe check that there isn't something strange in /usr/share/applications/steam.desktop or ~/Desktop/steam.desktop?

Ccodingthat 2020-03-10 github

@kisak-valve Thanks for the lead! I'm not sure why I'd have anything abnormal in either of those places, since I don't believe I've touched those files---and actually, ~/Desktop/steam.desktop does not exist---but you were right, /usr/share/applications/steam.desktop had exactly what you said under [Desktop Action Store] (and nowhere else).

Making the change you suggested did not change the behaviour, even with a Firefox restart, but then I saw that in the first section in the file, [Desktop Entry], the line looked like this:

Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam' %U

When I changed that to simply Exec=steam %U it suddenly worked, even without a Firefox restart. Great!

Also, moving the final apostrophe to after the %U like this also worked:

Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam %U'

But why would that line be incorrect in the first place? (And wouldn't it make sense that the issue remain open until that's discovered/fixed?)

Regardless, thanks for your help! Happy to have a solution. :)

Ccodingthat 2020-03-10 github

Both my apostrophe-moving variant and your original suggestion seem to be working around the -c usage, though:

           -c               Read commands from the command_string operand
                            instead of from the standard input.  Special
                            parameter 0 will be set from the command_name op‐
                            erand and the positional parameters ($1, $2, etc.)
                            set from the remaining argument operands.
Kkisak-valve maintainer 2020-03-10 github

Taking a look at /usr/share/applications/steam.desktop inside of https://steamcdn-a.akamaihd.net/client/installer/steam.deb or https://packages.ubuntu.com/bionic/steam, that change is from outside of Valve's or the distro's packaging.

Ccodingthat 2020-03-10 github

Bizarre. Beats me what made that change, then. Thank you for humouring me and verifying! @kisak-valve :100:

Ssmcv 2020-03-10 github
Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam' %U

I assume STEAM_FRAME_FORCE_CLOSE=1 was a workaround for ... something?

The correct way to spell this would have been either

Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam "$@"' sh %U

(so that $0 gets set to sh, and the URL ends up in $1 as intended)

[edited: without the "$@" the first version wouldn't have worked as intended; but the second version is better anyway]

or, for the same practical effect but more simply,

Exec=env STEAM_FRAME_FORCE_CLOSE=1 steam %U
Ccodingthat 2020-04-15 github

Hmm...a fresh install of Steam via the software manager on a fresh install of Linux Mint 19.3 also showed this file with the apostrophe before the end of that line. Anyone know off-hand who to contact about that? (I guess it's specific to Linux Mint, since you checked upstream Ubuntu already...)

Ssmcv 2020-04-15 github

a fresh install of Steam via the software manager on a fresh install of Linux Mint 19.3 also showed this file with the apostrophe before the end of that line

Please be more specific? What is in the desktop file?

Anyone know off-hand who to contact about that?

Linux Mint, unless you got your copy of Steam from https://repo.steampowered.com/steam/.

Ssmcv 2020-04-15 github

Also, moving the final apostrophe to after the %U like this also worked:

Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam %U'

The Desktop Entry Specification says this is not valid:

"Field codes must not be used inside a quoted argument, the result of field code expansion inside a quoted argument is undefined"

It might work in your browser/desktop environment, but it probably won't work as intended in others.

The intended Exec line is:

Exec=/usr/bin/steam %U

(or wherever else the Steam executable has been installed, for example /usr/games/steam on Debian).

If you need to set an environment variable when launching Steam to work around something, something with env similar to the last line of https://github.com/ValveSoftware/steam-for-linux/issues/6942#issuecomment-597113943 is going to be the most efficient and robust way to achieve that - it avoids all the shell-quoting issues. However, if you need to set an environment variable when launching Steam, please consider reporting that as a separate issue so that it can be fixed in Steam instead.

Ccodingthat 2020-04-16 github

@smcv The file /usr/share/applications/steam.desktop (fresh after OS install, Steam install, and all updates) contained Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam' %U. I didn't mean to imply that moving it to the end was the solution—I had read your previous explanation and appreciated it, thanks! :)

What I'm wondering is, where this broken file is actually coming from / who the maintainers are (Linux Mint–specific Steam package?)

Ssmcv 2020-04-16 github

dpkg -S /usr/share/applications/steam.desktop would tell you which package installed that file. If it's Valve's steam-launcher package, debsums -a steam-launcher would tell you whether that package is intact or has been modified locally behind the packaging system's back (this requires the debsums package to be installed). If it's Debian's/Ubuntu's steam package, the equivalent command would be debsums -a steam:i386.

I don't know whether the maintainers of Linux Mint provide an unmodified steam-launcher package from Valve, or an unmodified steam package from Ubuntu (which isn't the same and is somewhat out of date, but I'm not aware of it having STEAM_FRAME_FORCE_CLOSE=1), or their own modified package; and I don't know whether they apply any local hacks to it. You'd have to ask a Linux Mint support channel. Valve does not have direct control over, or knowledge of, what "the software manager on a fresh install of Linux Mint 19.3" would provide.

Ccodingthat 2020-04-16 github

The first command said steam:i386, which makes sense because I used Linux Mint's "Software Manager" app to install Steam, rather than downloading directly from Valve, since in a recent issue I was told that it was better to use the distro package where possible.

But you're right:

$ debsums -a steam:i386
/usr/games/steam                                                              OK
/usr/lib/games/steam/steam                                                    OK
/usr/share/applications/steam.desktop                                     FAILED
/usr/share/doc/steam/README.Debian                                            OK
/usr/share/doc/steam/changelog.Debian.gz                                      OK
/usr/share/doc/steam/copyright                                                OK
/usr/share/icons/hicolor/16x16/apps/steam.png                                 OK
/usr/share/icons/hicolor/24x24/apps/steam.png                                 OK
/usr/share/icons/hicolor/256x256/apps/steam.png                               OK
/usr/share/icons/hicolor/32x32/apps/steam.png                                 OK
/usr/share/icons/hicolor/48x48/apps/steam.png                                 OK
/usr/share/icons/hicolor/48x48/apps/steam_tray_mono.png                       OK
/usr/share/lintian/overrides/steam                                            OK
/usr/share/man/man6/steam.6.gz                                                OK

No idea what would be modifying it outside Steam though.

Interestingly, if I put that line to "the normal" Exec=/usr/bin/steam %U, debsums still reports it FAILED. I guess it's modified in other ways, too...

Anyway, thanks for confirming—I thought maybe Valve had a liaison list or something. I'll ask the Mint folks.

Ssmcv 2020-04-16 github

It looks like that's the package from Debian/Ubuntu, where the normal Exec line would be Exec=/usr/games/steam %U.

Ccodingthat 2020-04-17 github

Interestingly, putting that line in the .desktop file made the Steam shortcut disappear from the desktop "start" menu. Changing it to your other suggestion, Exec=env STEAM_FRAME_FORCE_CLOSE=1 steam %U, made it instantly reappear.