File tree Expand file tree Collapse file tree 4 files changed +8
-13
lines changed Expand file tree Collapse file tree 4 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 1
1
import { TAG } from '@/api/const' ;
2
- import { SHA256 } from '. /toolkit' ;
2
+ import { SHA256 } from '@/api /toolkit' ;
3
3
4
4
type TInstanceBadgeTag = ( id : string ) => string ;
5
5
type TSymbolBadgeTag = ( symbolName : string , symbolId : string ) => string ;
@@ -63,7 +63,7 @@ export async function post(
63
63
try {
64
64
window . postMessage (
65
65
{ source : 'jsdiff-console-to-proxy-inprogress' , on : true } ,
66
- window . location . origin
66
+ '*'
67
67
) ;
68
68
69
69
for ( const key of [ 'push' , 'left' , 'right' ] ) {
@@ -82,14 +82,14 @@ export async function post(
82
82
83
83
window . postMessage (
84
84
{ source : 'jsdiff-console-to-proxy-compare' , payload } ,
85
- window . location . origin
85
+ '*'
86
86
) ;
87
87
} catch ( error ) {
88
88
console . error ( 'console.diff()' , error ) ;
89
89
90
90
window . postMessage (
91
91
{ source : 'jsdiff-console-to-proxy-inprogress' , on : false } ,
92
- window . location . origin
92
+ '*'
93
93
) ;
94
94
}
95
95
}
Original file line number Diff line number Diff line change @@ -5,12 +5,7 @@ export function proxyMessageGate(
5
5
callbackCompare : ( e : MessageEvent < ICompareMessage > ) => Promise < void >
6
6
) {
7
7
return function ( e : MessageEvent ) {
8
- if (
9
- e . origin === window . location . origin &&
10
- e . source === window &&
11
- typeof e . data === 'object' &&
12
- e . data !== null
13
- ) {
8
+ if ( e . source === window && typeof e . data === 'object' && e . data !== null ) {
14
9
if ( 'jsdiff-console-to-proxy-inprogress' === e . data . source ) {
15
10
callbackInprogress ( e ) ;
16
11
} else if ( 'jsdiff-console-to-proxy-compare' === e . data . source ) {
@@ -94,7 +89,7 @@ function processComparisonObject(
94
89
return rv ;
95
90
}
96
91
97
- function handleResponse ( error : chrome . runtime . LastError | undefined ) : void {
92
+ function handleResponse ( ) : void {
98
93
if ( ! isIgnorable ( chrome . runtime . lastError ) ) {
99
94
console . error ( chrome . runtime . lastError ) ;
100
95
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export function hasValue(o: unknown): boolean {
4
4
5
5
export async function SHA256 ( data : string ) : Promise < string > {
6
6
const textAsBuffer = new TextEncoder ( ) . encode ( data ) ;
7
- const hashBuffer = await window . crypto . subtle . digest ( 'SHA-256' , textAsBuffer ) ;
7
+ const hashBuffer = await crypto . subtle . digest ( 'SHA-256' , textAsBuffer ) ;
8
8
const hashArray = Array . from ( new Uint8Array ( hashBuffer ) ) ;
9
9
const digest = hashArray
10
10
. map ( ( b ) => b . toString ( 16 ) . padStart ( 2 , '0' ) . toUpperCase ( ) )
Original file line number Diff line number Diff line change @@ -33,4 +33,4 @@ Object.assign(console, {
33
33
} ,
34
34
} ) ;
35
35
36
- console . debug ( ' ✚ console.diff()' ) ;
36
+ console . debug ( ` ✚ console.diff()` ) ;
You can’t perform that action at this time.
0 commit comments