@@ -11,20 +11,42 @@ export default {
1111 whiteList : [ "https://*.facebook.com/*" , "https://*.messenger.com/*" ] ,
1212
1313 onDocumentStart : ( ) => {
14- const WebSocketOrig = window . WebSocket ;
14+ // const WebSocketOrig = window.WebSocket;
1515
16- window . WebSocket = function fakeConstructor ( dt , config ) {
17- const websocket_instant = new WebSocketOrig ( dt , config ) ;
18- websocket_instant . addEventListener ( "message" , async function ( achunk ) {
19- // const utf8_str = new TextDecoder("utf-8").decode(achunk.data);
20- // Do something here
21- // console.log(utf8_str);
22- } ) ;
23- return websocket_instant ;
24- } ;
16+ // window.WebSocket = function fakeConstructor(dt, config) {
17+ // const websocket_instant = new WebSocketOrig(dt, config);
18+ // websocket_instant.addEventListener("message", async function (achunk) {
19+ // // const utf8_str = new TextDecoder("utf-8").decode(achunk.data);
20+ // // Do something here
21+ // // console.log(utf8_str);
22+ // });
23+ // return websocket_instant;
24+ // };
2525
26- window . WebSocket . prototype = WebSocketOrig . prototype ;
27- window . WebSocket . prototype . constructor = window . WebSocket ;
26+ // window.WebSocket.prototype = WebSocketOrig.prototype;
27+ // window.WebSocket.prototype.constructor = window.WebSocket;
28+
29+ // window.addEventListener(
30+ // "message",
31+ // function (t) {
32+ // t.source == window && console.log(t);
33+ // },
34+ // !1
35+ // );
36+
37+ let emptyFunc = void 0 ;
38+ Object . defineProperty ( window , "__d" , {
39+ get : ( ) => emptyFunc ,
40+ set : ( i ) => {
41+ const c = new Proxy ( i , {
42+ apply : async function ( moduleName , dependencies , args ) {
43+ console . log ( arguments ) ;
44+ return moduleName ( ...args ) ;
45+ } ,
46+ } ) ;
47+ emptyFunc = c ;
48+ } ,
49+ } ) ;
2850 } ,
2951
3052 onDocumentIdle : ( ) => {
@@ -62,5 +84,16 @@ export default {
6284 return MWV2ChatUnsentMessageOrig . apply ( this , arguments ) ;
6385 } ;
6486 } ) ;
87+
88+ // Test who is typing
89+ requireLazy ( [ "LSUpdateTypingIndicator" ] , ( LSUpdateTypingIndicator ) => {
90+ const LSUpdateTypingIndicatorOrig = LSUpdateTypingIndicator ;
91+ console . log ( "abc" ) ;
92+
93+ LSUpdateTypingIndicator = function ( ...args ) {
94+ console . log ( args ) ;
95+ return LSUpdateTypingIndicatorOrig . apply ( this , arguments ) ;
96+ } ;
97+ } ) ;
6598 } ,
6699} ;
0 commit comments