mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-02 11:26:46 +02:00
Show debug info
This commit is contained in:
@@ -11,6 +11,11 @@ type BxFlags = Partial<{
|
||||
FeatureGates: {[key: string]: boolean} | null,
|
||||
|
||||
IsSupportedTvBrowser: boolean,
|
||||
|
||||
DeviceInfo: Partial<{
|
||||
deviceType: 'android' | 'android-tv' | 'webos' | 'unknown',
|
||||
userAgent: string,
|
||||
}>,
|
||||
}>
|
||||
|
||||
// Setup flags
|
||||
@@ -25,6 +30,11 @@ const DEFAULT_FLAGS: BxFlags = {
|
||||
|
||||
ForceNativeMkbTitles: [],
|
||||
FeatureGates: null,
|
||||
|
||||
DeviceInfo: {
|
||||
deviceType: 'unknown',
|
||||
userAgent: window.navigator.userAgent,
|
||||
},
|
||||
}
|
||||
|
||||
export const BX_FLAGS: BxFlags = Object.assign(DEFAULT_FLAGS, window.BX_FLAGS || {});
|
||||
|
@@ -35,7 +35,13 @@ function createElement<T=HTMLElement>(elmName: string, props: {[index: string]:
|
||||
if (hasNs) {
|
||||
$elm.setAttributeNS(null, key, props[key]);
|
||||
} else {
|
||||
$elm.setAttribute(key, props[key]);
|
||||
if (key === 'on') {
|
||||
for (const eventName in props[key]) {
|
||||
$elm.addEventListener(eventName, props[key][eventName]);
|
||||
}
|
||||
} else {
|
||||
$elm.setAttribute(key, props[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user