push
github
1320 of 1468 branches covered (89.92%)
Branch coverage included in aggregate %.
104 of 2237 new or added lines in 31 files covered. (4.65%)
5289 of 8941 relevant lines covered (59.15%)
31.8 hits per line
NEW
|
import socketStore from '../helpers/socket'; |
× |
NEW
|
import { PageSpyPlugin, SpySystem } from '../types'; |
× |
NEW
|
import { getRandomId } from '../utils'; |
× |
NEW
|
import { DEVICE_INFO } from '../utils/constants'; |
× |
NEW
|
import { makeMessage } from '../utils/message'; |
× |
NEW
|
|
× |
NEW
|
export default class SystemPlugin implements PageSpyPlugin { |
× |
NEW
|
public name = 'SystemPlugin'; |
× |
NEW
|
|
× |
NEW
|
public static hasInitd = false; |
× |
NEW
|
|
× |
NEW
|
public onInit() {
|
× |
NEW
|
if (SystemPlugin.hasInitd) return; |
× |
NEW
|
SystemPlugin.hasInitd = true;
|
× |
NEW
|
|
× |
NEW
|
const id = getRandomId();
|
× |
NEW
|
socketStore.broadcastMessage( |
× |
NEW
|
makeMessage('system', { |
× |
NEW
|
id, |
× |
NEW
|
system: { |
× |
NEW
|
ua: DEVICE_INFO,
|
× |
NEW
|
}, |
× |
NEW
|
features: {},
|
× |
NEW
|
} as SpySystem.DataItem), |
× |
NEW
|
false,
|
× |
NEW
|
); |
× |
NEW
|
} |
× |
NEW
|
|
× |
NEW
|
public onReset() {
|
× |
NEW
|
SystemPlugin.hasInitd = false;
|
× |
NEW
|
} |
× |
NEW
|
} |
× |