Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

Commit 0688d32

Browse files
author
bhasher
committed
Starting debbugings methods
1 parent 4114c72 commit 0688d32

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed
File renamed without changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* This module deals with getting current specifications for debugging.
3+
* @author Brieuc Dubois
4+
* @date Created on 18/11/2020
5+
* @date Last modification on 19/11/2020
6+
* @version 1.0.0
7+
*/
8+
9+
export default class Specifications{
10+
/**
11+
* Get information about current implementation
12+
*/
13+
static user() {
14+
return {
15+
general: {
16+
languages: navigator.languages,
17+
},
18+
navigator: {
19+
userAgent: navigator.userAgent,
20+
appCodeName: navigator.appCodeName,
21+
appName: navigator.appName,
22+
appVersion: navigator.appVersion,
23+
buildId: navigator.buildID,
24+
doNotTrack: navigator.doNotTrack,
25+
plugins: Specifications.plugins(),
26+
},
27+
services:{
28+
websocket: Boolean(window.WebSocket),
29+
cookieEnabled: navigator.cookieEnabled,
30+
},
31+
system: {
32+
oscpu: navigator.oscpu,
33+
platform: navigator.platform,
34+
},
35+
screen: {
36+
resolution: screen.width + 'x' + screen.height,
37+
color_depth: screen.colorDepth + ' bits',
38+
window: window.innerWidth + 'x' + window.innerHeight,
39+
},
40+
}
41+
}
42+
43+
/**
44+
* Get list of plugins
45+
* @return {{}}
46+
*/
47+
static plugins(){
48+
let res = {};
49+
for (let i = 0; i < navigator.plugins.length; i++){
50+
const plugin = navigator.plugins[i];
51+
52+
if (plugin) {
53+
res[plugin.name] = plugin.description;
54+
}
55+
}
56+
return res;
57+
}
58+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* This module deals with track bugs.
3+
* @author Brieuc Dubois
4+
* @date Created on 18/11/2020
5+
* @date Last modification on 18/11/2020
6+
* @version 1.0.0
7+
*/
8+
9+
class Track{
10+
constructor() {
11+
12+
}
13+
}

src/publics/js/dev/utils/websocket/socket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @date Last modification on 16/11/2020
66
* @version 1.0.0
77
*/
8-
import Debug from "/js/dev/utils/debug.js";
8+
import Debug from "/js/dev/utils/debugging/debug.js";
99
import EventManager from "/js/dev/utils/events.js";
1010

1111
export default class Socket{
@@ -72,9 +72,9 @@ export default class Socket{
7272
* @param {MessageEvent} e
7373
*/
7474
onMessage(e){
75-
Debug.debug('RECEIVE PACKET', e.data);
7675
try{
7776
const data = JSON.parse(e.data);
77+
Debug.debug('RECEIVE PACKET', data);
7878
if(data.event && data.data) EventManager.triggerCustom(`socket.receive.${data.event}`, data.data);
7979
else {
8080
Debug.error('This packet hasn\'t valid event and data.', data);

0 commit comments

Comments
 (0)