@@ -3,30 +3,30 @@ import logo from '../../assets/img/logo_probely.svg';
33import help from '../../assets/img/help.svg' ;
44import './Popup.css' ;
55
6- const helpURL = 'https://help.probely.com/en/articles/5402869-how-to-record-a-sequence-with-probely-s- sequence-recorder-plugin ' ;
6+ const helpURL = 'https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-web-targets/use- sequence-recorder' ;
77
88const Popup = ( props ) => {
99 // 🔴
1010 // console.log('PROPS :: ', props);
1111 const [ isRecording , setIsRecording ] = useState ( false ) ;
1212 const [ startURL , setStartURL ] = useState ( '' ) ;
1313 const [ recordingData , setRecordingData ] = useState ( [ ] ) ;
14- const [ copyStatus , setCopyStatus ] = useState ( { status : false , error : false , msg : 'Successfully copied to clipboard' } ) ;
14+ const [ copyStatus , setCopyStatus ] = useState ( { status : false , error : false , msg : 'Successfully copied to clipboard' } ) ;
1515
1616 useEffect ( ( ) => {
1717 if ( chrome && chrome . storage ) {
1818 chrome . storage . sync . get ( [ 'isRecording' ] , ( data ) => {
1919 const recording = data . isRecording ;
20- if ( recording ) {
20+ if ( recording ) {
2121 setIsRecording ( true ) ;
2222 ( chrome . action || chrome . browserAction ) . setBadgeText ( {
2323 text : '🔴' ,
24- } , ( ) => { } ) ;
24+ } , ( ) => { } ) ;
2525 } else {
2626 setIsRecording ( false ) ;
2727 ( chrome . action || chrome . browserAction ) . setBadgeText ( {
2828 text : '' ,
29- } , ( ) => { } ) ;
29+ } , ( ) => { } ) ;
3030 }
3131 } ) ;
3232 chrome . runtime . onMessage . addListener ( ( data , sender , sendResponse ) => {
@@ -51,8 +51,8 @@ const Popup = (props) => {
5151 if ( chrome ) {
5252 ( chrome . action || chrome . browserAction ) . setBadgeText ( {
5353 text : '🔴' ,
54- } , ( ) => { } ) ;
55- chrome . storage . sync . set ( { isRecording : true } , ( ) => {
54+ } , ( ) => { } ) ;
55+ chrome . storage . sync . set ( { isRecording : true } , ( ) => {
5656 chrome . runtime . sendMessage ( {
5757 messageType : 'start' ,
5858 event : {
@@ -63,7 +63,7 @@ const Popup = (props) => {
6363 url : startURL ,
6464 } ,
6565 } ) ;
66- chrome . tabs . create ( { active : true , url : startURL } , ( aa ) => {
66+ chrome . tabs . create ( { active : true , url : startURL } , ( aa ) => {
6767 } ) ;
6868 } ) ;
6969 }
@@ -74,15 +74,15 @@ const Popup = (props) => {
7474 if ( chrome ) {
7575 ( chrome . action || chrome . browserAction ) . setBadgeText ( {
7676 text : '' ,
77- } , ( ) => { } ) ;
78- chrome . storage . sync . set ( { isRecording : false } , ( ) => {
77+ } , ( ) => { } ) ;
78+ chrome . storage . sync . set ( { isRecording : false } , ( ) => {
7979 askForRecordingData ( ) ;
8080
81- chrome . tabs . query ( { active : true , currentWindow : true } , ( tabs ) => {
81+ chrome . tabs . query ( { active : true , currentWindow : true } , ( tabs ) => {
8282 if ( tabs && tabs . length ) {
8383 const curTab = tabs [ 0 ] ;
8484 chrome . tabs . remove ( curTab . id ) ;
85- chrome . tabs . create ( { active : true , url : './review.html' } , ( aa ) => {
85+ chrome . tabs . create ( { active : true , url : './review.html' } , ( aa ) => {
8686 } ) ;
8787 }
8888 } ) ;
@@ -126,7 +126,7 @@ const Popup = (props) => {
126126 msg : 'Successfully copied to clipboard'
127127 } ) ;
128128 setTimeout ( ( ) => {
129- setCopyStatus ( { status : false , error : false , msg : '' } ) ;
129+ setCopyStatus ( { status : false , error : false , msg : '' } ) ;
130130 } , 3000 ) ;
131131 } else {
132132 setCopyStatus ( {
@@ -135,7 +135,7 @@ const Popup = (props) => {
135135 msg : 'Error on copy to clipboard'
136136 } ) ;
137137 setTimeout ( ( ) => {
138- setCopyStatus ( { status : false , error : false , msg : '' } ) ;
138+ setCopyStatus ( { status : false , error : false , msg : '' } ) ;
139139 } , 5000 ) ;
140140 }
141141 }
@@ -144,7 +144,7 @@ const Popup = (props) => {
144144 function onClickDownload ( ) {
145145 var blob = new Blob ( [ JSON . stringify ( recordingData , null , 2 ) ] , {
146146 type : "text/plain;charset=utf-8"
147- } ) ;
147+ } ) ;
148148 var a = document . createElement ( 'a' ) ;
149149 a . download = 'snyk-api-and-web-recording.json' ;
150150 a . rel = 'noopener' ;
@@ -169,7 +169,7 @@ const Popup = (props) => {
169169
170170 function onClickHelpLink ( ev ) {
171171 ev . preventDefault ( ) ;
172- chrome . tabs . create ( { active : true , url : helpURL } , ( aa ) => {
172+ chrome . tabs . create ( { active : true , url : helpURL } , ( aa ) => {
173173 } ) ;
174174 }
175175
@@ -181,8 +181,8 @@ const Popup = (props) => {
181181 </ header >
182182 < div className = "App-container" >
183183 < p >
184- Use this plugin to record a sequence of steps to be followed by Snyk API & Web during a scan . { ' ' }
185- When you finish recording, upload the script to your target settings.
184+ Use this plugin to record a sequence of steps to be followed by Snyk API & Web during a scan . { ' ' }
185+ When you finish recording, upload the script to your target settings.
186186 </ p >
187187 < p className = "help-container" >
188188 < a
@@ -202,7 +202,7 @@ const Popup = (props) => {
202202 < div className = "input-url-container" >
203203 { isRecording ?
204204 null
205- :
205+ :
206206 < >
207207 < label className = "start_url_label" htmlFor = "start_url" > Type the start URL to be recorded</ label >
208208 < input
@@ -221,14 +221,14 @@ const Popup = (props) => {
221221 }
222222 </ div >
223223 < div className = "buttons-container" >
224- { isRecording ?
224+ { isRecording ?
225225 // eslint-disable-next-line jsx-a11y/anchor-is-valid
226226 < p > < a
227227 href = "#"
228228 className = "App-button"
229229 onClick = { ( ev ) => { onClickStartStopRecording ( ev , false ) ; } }
230230 > Stop recording</ a > </ p >
231- :
231+ :
232232 < button
233233 type = "submit"
234234 className = "App-button"
@@ -260,15 +260,15 @@ const Popup = (props) => {
260260 > Clear recording data</ button >
261261 </ div >
262262 </ >
263- : null }
263+ : null }
264264 < div className = "copy-status-container" >
265265 { copyStatus . status ?
266- < div className = { copyStatus . error ? 'copy-status error' : 'copy-status success' } > { copyStatus . msg } </ div >
267- : null }
266+ < div className = { copyStatus . error ? 'copy-status error' : 'copy-status success' } > { copyStatus . msg } </ div >
267+ : null }
268268 </ div >
269- { recordingData . length ?
269+ { recordingData . length ?
270270 < textarea id = "input-copy-to-clipboard" defaultValue = { JSON . stringify ( recordingData , null , 2 ) } > </ textarea >
271- : null }
271+ : null }
272272 </ div >
273273 ) ;
274274} ;
0 commit comments