Skip to content
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

changes in socketclient.js stops MMM-RemoteControl to work #1973

Closed
khassel opened this issue Apr 3, 2020 · 4 comments
Closed

changes in socketclient.js stops MMM-RemoteControl to work #1973

khassel opened this issue Apr 3, 2020 · 4 comments

Comments

@khassel
Copy link
Collaborator

khassel commented Apr 3, 2020

The changes in socketclient.js introduced with this PR #1937 in v2.11.0 breaks MMM-RemoteControl, maybe other modules too.

See Jopyth/MMM-Remote-Control#185

After reverting the changes in socketclient.js the module works again.

@khassel
Copy link
Collaborator Author

khassel commented Apr 4, 2020

Found 2 issues:

  • we can't use window.location.pathname because modules can use own html sites referencing socketclient.js. E.g. in http://192.168.xxx.yyy:8080/remote.html window.location.pathname has the value /remote.html instead of expected /. This could may solved defining a subPath value in the config and using this value instead of window.location.pathname.

  • in index.html the line
    <script type="text/javascript" src="/socket.io/socket.io.js"></script>
    was replaced in the above PR with
    <script type="text/javascript" src="socket.io/socket.io.js"></script>
    which is a good correction, but many module developers copied this line in their html site.
    This is a minor issue: If someone will use such a module with a subpath <> /, the above line must corrected in the module html.

@Legion2
Copy link
Contributor

Legion2 commented Apr 5, 2020

This can be resolved by defining a basename in the configuration with a default value of /. basename is the used instead of window.location.pathname.

@Legion2
Copy link
Contributor

Legion2 commented Apr 5, 2020

@khassel I created a PR to fix the broken socket.io path #1976

@MichMich
Copy link
Collaborator

MichMich commented Apr 9, 2020

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants