@@ -23,7 +23,6 @@ import {ReportedStorage} from '../types/ReportedModel';
2323import { ZestScript , ZestScriptMessage } from '../types/zestScript/ZestScript' ;
2424import { ZestStatementWindowClose } from '../types/zestScript/ZestStatement' ;
2525import {
26- DOWNLOAD_RECORDING ,
2726 GET_ZEST_SCRIPT ,
2827 IS_FULL_EXTENSION ,
2928 LOCAL_STORAGE ,
@@ -173,33 +172,6 @@ function sendZestScriptToZAP(
173172 }
174173}
175174
176- function downloadZestScript ( zestScriptJSON : string , title : string ) : void {
177- const blob = new Blob ( [ zestScriptJSON ] , { type : 'application/json' } ) ;
178- const url = URL . createObjectURL ( blob ) ;
179-
180- const link = document . createElement ( 'a' ) ;
181- link . href = url ;
182- link . download = title + ( title . slice ( - 4 ) === '.zst' ? '' : '.zst' ) ;
183- link . style . display = 'none' ;
184-
185- document . body . appendChild ( link ) ;
186- link . click ( ) ;
187- document . body . removeChild ( link ) ;
188-
189- URL . revokeObjectURL ( url ) ;
190- }
191-
192- function pad ( i : number ) : string {
193- return `${ i } ` . padStart ( 2 , `0` ) ;
194- }
195-
196- function getDateString ( ) : string {
197- const now = new Date ( ) ;
198- return `${ now . getFullYear ( ) } -${ pad ( now . getMonth ( ) ) } -${ pad (
199- now . getDay ( )
200- ) } -${ pad ( now . getHours ( ) ) } -${ pad ( now . getMinutes ( ) ) } -${ pad ( now . getSeconds ( ) ) } `;
201- }
202-
203175async function handleMessage (
204176 request : MessageEvent ,
205177 zapurl : string ,
@@ -277,17 +249,6 @@ async function handleMessage(
277249 }
278250 break ;
279251 }
280- case DOWNLOAD_RECORDING : {
281- zestScript . getZestScript ( ) . then ( ( items ) => {
282- const msg = items as ZestScriptMessage ;
283- let site = '' ;
284- if ( request . data ) {
285- site = `${ request . data } -` ;
286- }
287- downloadZestScript ( msg . script , `zap-rec-${ site } ${ getDateString ( ) } .zst` ) ;
288- } ) ;
289- break ;
290- }
291252 case SET_SAVE_SCRIPT_ENABLE :
292253 Browser . storage . sync . set ( {
293254 zapenablesavescript : zestScript . getZestStatementCount ( ) > 0 ,
0 commit comments