code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Blocked autofocusing on a form control in a cross-origin subframe.

Open saviorZSC opened this issue 5 years ago • 10 comments

Hi: I installed the release 2.1698-vsc1.41.1, and I use this command and set a password to start it:

code-server --host 0.0.0.0 --port 8082

this is ok to run. But when i put it in iframe, when send the password will show this error on browser:

Blocked autofocusing on a form control in a cross-origin subframe.

This seems to be a cross-domain issue,but I can't found any setting to fix it. If you has any idea, please tell me. thanks you.

saviorZSC avatar Apr 02 '20 09:04 saviorZSC

Could you try with the latest release?

kylecarbs avatar Apr 09 '20 01:04 kylecarbs

Closing for inactivity. Happy to help though, if you are still experiencing the problem be sure to let us know!

kylecarbs avatar Apr 14 '20 14:04 kylecarbs

I am having this problem as well and would love to troubleshoot this if you can help.

merdely avatar Jan 17 '21 08:01 merdely

Does the autofocus block error prevent logging in entirely?

code-asher avatar Jan 19 '21 17:01 code-asher

In the iframe, yes. Outside of the iframe, no.

I'm trying to include it as an iframe in Home Assistant (not running the Home Assistant add-on... Running it in docker). When I click the link, I get the password page. When I enter my password correctly, it just reloads the password page. In the Chrome console I see the error noted in this thread.

merdely avatar Jan 19 '21 18:01 merdely

Ah, ok. I'll see if I can replicate.

code-asher avatar Jan 19 '21 20:01 code-asher

Will reopen as well.

nhooyr avatar Jan 21 '21 05:01 nhooyr

I don't know if this helps you guys, but I wanted to give you guys some more information.

I access home assistant by https://ha.mydomain.inside:8123. I accessed VS Code by https://vscode.mydomain.inside When I have:

panel_iframe:
  vscode:
    title: VS Code
    url: "https://vscode.mydomain.inside"
    icon: si:visualstudiocode

This configuration exhibited the problem described above.

Here's what I did yesterday:

  1. Created an nginx virtual host entry for ha.mydomain.inside on port 443
  2. Added the following for vscode under that virtual host entry:
  location /code-server/ {
    # "vscode:8080" is my nginx Docker instance connecting to my code-server Docker instance using Docker Compose
    proxy_pass http://vscode:8080/;
    # more nginx proxy options here
  }
  1. Updated my Home Assistant configuration with:
panel_iframe:
  vscode:
    title: VS Code
    url: "https://ha.mydomain.inside/code-server/"
    icon: si:visualstudiocode

So, since both Home Assistant and code-server are not running with the same hostname (ha.mydomain.inside), the problem goes away.

merdely avatar Feb 06 '21 17:02 merdely

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

stale[bot] avatar Nov 10 '21 20:11 stale[bot]

i have perhaps the same issue : impossible to login 2022-07-17_145025

warlordattack avatar Jul 17 '22 12:07 warlordattack