File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 9898 }
9999
100100 function getRequestData ( request , keyPath ) {
101+ var data = decodeURIComponent ( request . requestBody . match ( / d a t a = ( [ ^ & ] + ) / ) [ 1 ] ) ;
101102 try {
102- var data = JSON . parse ( atob ( decodeURIComponent ( request . requestBody . match ( / d a t a = ( [ ^ & ] + ) / ) [ 1 ] ) ) ) ;
103+ data = atob ( data ) ;
104+ } catch ( err ) {
105+ // plain json?
106+ }
107+ try {
108+ data = JSON . parse ( data ) ;
103109 ( keyPath || [ ] ) . forEach ( function ( key ) {
104110 data = data [ key ] ;
105111 } ) ;
18811887 return item . url . indexOf ( 'https://api-js.mixpanel.com/track/' ) === 0 ;
18821888 } )
18831889 . map ( function ( request ) {
1884- var b64 = decodeURIComponent ( request . requestBody . split ( 'data=' ) [ 1 ] . split ( '&' ) [ 0 ] ) ;
1885- return JSON . parse ( atob ( b64 ) ) ;
1890+ return getRequestData ( request ) ;
18861891 } ) ;
18871892 }
18881893
You can’t perform that action at this time.
0 commit comments