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

JSON.parse for URL-Params missing #642

Closed
psi-4ward opened this issue Oct 8, 2021 · 4 comments · Fixed by #786
Closed

JSON.parse for URL-Params missing #642

psi-4ward opened this issue Oct 8, 2021 · 4 comments · Fixed by #786

Comments

@psi-4ward
Copy link
Contributor

In
https://github.com/jitsi/jitsi-meet-electron/blob/master/app/features/conference/components/Conference.js#L216
we do not JSON.parse() the values of URL-Params (like config.channelLastN=0) which leads to errors cause it's all strings.

https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/util/parseURLParams.js#L57

@psi-4ward
Copy link
Contributor Author

const hashParameters = url.hash.substring(1).split('&')
            .reduce((res, item) => {
                // eslint-disable-next-line prefer-const
                let [ key, value ] = item.split('=');

                try {
                    const decoded = decodeURIComponent(value).replace(/\\&/, '&');

                    value = decoded === 'undefined' ? undefined : Bourne.parse(decoded);
                } catch (e) {
                    console.warn(`Failed to parse URL parameter value: ${String(value)}`, e);
                }
                res[key] = value;

                return res;
            }, {});

@saghul
Copy link
Member

saghul commented Oct 9, 2021

Yep we should parse them. Would you be willing to write a patch?

@csett86
Copy link
Member

csett86 commented Aug 22, 2022

As asked today in the community call, this also is an issue for parameters that are boolean, eg. disableChatSmileys=true, as also they are then all strings and not boolean.

@psi-4ward
Copy link
Contributor Author

Oh damn. Lost that.

In another project I'll try to guess the type from the default value.

@csett86 csett86 linked a pull request Aug 25, 2022 that will close this issue
csett86 pushed a commit that referenced this issue Aug 25, 2022
d3473r pushed a commit to d3473r/jitsi-meet-electron that referenced this issue Sep 1, 2023
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

Successfully merging a pull request may close this issue.

3 participants