github
1318 of 1466 branches covered (89.9%)
Branch coverage included in aggregate %.
104 of 2237 new or added lines in 31 files covered. (4.65%)
5272 of 8831 relevant lines covered (59.7%)
32.17 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
|
} |
× |