-
Notifications
You must be signed in to change notification settings - Fork 468
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
Comments
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;
}, {}); |
Yep we should parse them. Would you be willing to write a patch? |
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. |
Oh damn. Lost that. In another project I'll try to guess the type from the default value. |
csett86
pushed a commit
that referenced
this issue
Aug 25, 2022
Used https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/util/parseURLParams.ts and removed the typescript stuff and replaced deprecated substr() Closes: #642 Signed-off-by: Christoph Wiechert <[email protected]>
d3473r
pushed a commit
to d3473r/jitsi-meet-electron
that referenced
this issue
Sep 1, 2023
Used https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/util/parseURLParams.ts and removed the typescript stuff and replaced deprecated substr() Closes: jitsi#642 Signed-off-by: Christoph Wiechert <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: