Skip to content

Code-server can not install as desktop PWA in current version #1181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tgly307 opened this issue Nov 16, 2019 · 3 comments
Closed

Code-server can not install as desktop PWA in current version #1181

tgly307 opened this issue Nov 16, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@tgly307
Copy link

tgly307 commented Nov 16, 2019

  • code-server version: 2.1692-vsc1.39.2
  • OS Version: centOS 7, docker version 18.09.0

Description

Code-server can be installed as desktop PWA in past version. But in current version, code-server can not be installed, the install icon in chrome address bar is missing. I found that there is no service worker in dev-tools/application.

Steps to Reproduce

  1. install code-server by docker image
  2. open code-server in chrome and check
@tgly307 tgly307 added the bug Something isn't working label Nov 16, 2019
@sr229
Copy link
Contributor

sr229 commented Nov 17, 2019

Unfortunately, this is a upstream issue, which we cannot solve by our own. If you think this also has the same behavior with VS Online, open an issue in Microsoft/vscode as well.

@sr229 sr229 closed this as completed Nov 17, 2019
@geiseri
Copy link
Contributor

geiseri commented Feb 13, 2020

Can you reference where this is upstream? As far as I can tell it is an issue of a malformed manifest.

{
	"name": "code-server",
	"short_name": "code-server",
	"start_url": ".",
	"display": "standalone",
	"background-color": "#fff",
	"description": "Run VS Code on a remote server.",
	"icons": [{
		"src": "./code-server.png",
		"sizes": "384x384",
		"type": "image/png"
	}]
}

My command to start it is: code-server --host=0.0.0.0 --auth=none --port=8080 --base-path=/code I am behind a reverse proxy then that will forward https://gateway.foo.com/code to the local docker on port 8080.

When I open the link the first thing is see is that the icon for code-server.png is not valid because it is looking for https://gateway.foo.com/code-server.png instead of https://gateway.foo.com/code/code-server.png. In general, it looks like some of the earlier calls go to https://gateway.foo.com and not https://gateway.foo.com/code, but somehow the server still replies so it works, but it might confuse the workers.

Is the upstream bug in loader.js? As far as I can tell that is what registers the service workers. It loads from / first and then later it will use the correct base path.

@code-asher
Copy link
Member

code-asher commented Feb 18, 2020 via email

@nhooyr nhooyr reopened this Feb 18, 2020
code-asher added a commit that referenced this issue Feb 18, 2020
Might fix #1181, although not for the reasons I initially
though (because the URLs are resolved from the manifest path, not the
path of the current page). This should ensure that the URLs used by the
manifest are always correct regardless of the manifest's path.
code-asher added a commit that referenced this issue Feb 27, 2020
To make installing as a PWA possible. Fixes #1181.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants