function deleteRowFromTable(row){
        row.parentNode.removeChild(row);       

        var url = row.getElementsByTagName('td')[0].innerText;

        chrome.storage.sync.get({list:[]}, function(data){
            if(!chrome.runtime.error){
                for(var i in data.list){
                    if(data.list[i].url == url){
                        data.list.splice(i, 1);
                    }
                }
            chrome.storage.sync.set({
                list:data.list
            }, function(){
                console.log('removed from list');
            });
            }
        });

        //delete directory with all its content
        cs.deleteDir('screenshots/'+getDirnameFromUrl(url), {recursive: true}, function() {
            console.log('deleted directory');
        });
    }
/**
    *   Function that deletes a row from the table. (Deletes an url from the followed list). When the row is deleted
    *   the directory created once it was added is now deleted.
    */
Function that deletes a row from the table. (Deletes an url from the followed list). When the row is deleted
the directory created once it was added is now deleted.
Function that deletes a row from the table . ( Deletes an url from the followed list ) . When the row is deleted the directory created once it was added is now deleted .
function deleteRowFromTable(row){
        row.parentNode.removeChild(row);       
        var url = row.getElementsByTagName('td')[0].innerText;
        chrome.storage.sync.get({list:[]}, function(data){
            if(!chrome.runtime.error){
                for(var i in data.list){
                    if(data.list[i].url == url){
                        data.list.splice(i, 1);
                    }
                }
            chrome.storage.sync.set({
                list:data.list
            }, function(){
                console.log('removed from list');
            });
            }
        });
        cs.deleteDir('screenshots/'+getDirnameFromUrl(url), {recursive: true}, function() {
            console.log('deleted directory');
        });
    }
function deleteRowFromTable ( row ) { row . parentNode . removeChild ( row ) ; var url = row . getElementsByTagName ( 'td' ) [ 0 ] . innerText ; chrome . storage . sync . get ( { list : [ ] } , function ( data ) { if ( ! chrome . runtime . error ) { for ( var i in data . list ) { if ( data . list [ i ] . url == url ) { data . list . splice ( i , 1 ) ; } } chrome . storage . sync . set ( { list : data . list } , function ( ) { console . log ( 'removed from list' ) ; } ) ; } } ) ; cs . deleteDir ( 'screenshots/' + getDirnameFromUrl ( url ) , { recursive : true } , function ( ) { console . log ( 'deleted directory' ) ; } ) ; }
Function that deletes a row from the table.
Function that deletes a row from the table .
//delete directory with all its content