mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Merge branch 'jryans/device-name' into 'element'
Use a safe but sane device name See merge request new-vector/element/element-web/element-web!10
This commit is contained in:
commit
1d90820b10
@ -173,20 +173,21 @@ export default class WebPlatform extends VectorBasePlatform {
|
||||
}
|
||||
|
||||
getDefaultDeviceDisplayName(): string {
|
||||
return "unknown browser " + Math.round(Number.MAX_SAFE_INTEGER * Math.random());
|
||||
// TODO: Revert this after launch
|
||||
// // strip query-string and fragment from uri
|
||||
// const u = url.parse(window.location.href);
|
||||
// u.protocol = "";
|
||||
// u.search = "";
|
||||
// u.hash = "";
|
||||
// // Remove trailing slash if present
|
||||
// u.pathname = u.pathname.replace(/\/$/, "");
|
||||
|
||||
// strip query-string and fragment from uri
|
||||
const u = url.parse(window.location.href);
|
||||
u.protocol = "";
|
||||
u.search = "";
|
||||
u.hash = "";
|
||||
// Remove trailing slash if present
|
||||
u.pathname = u.pathname.replace(/\/$/, "");
|
||||
// let appName = u.format();
|
||||
// // Remove leading slashes if present
|
||||
// appName = appName.replace(/^\/\//, "");
|
||||
// // `appName` is now in the format `develop.element.io`.
|
||||
|
||||
let appName = u.format();
|
||||
// Remove leading slashes if present
|
||||
appName = appName.replace(/^\/\//, "");
|
||||
// `appName` is now in the format `develop.element.io`.
|
||||
const appName = "Riot Web";
|
||||
|
||||
const ua = new UAParser();
|
||||
const browserName = ua.getBrowser().name || "unknown browser";
|
||||
|
Loading…
Reference in New Issue
Block a user