| 50 | } |
| 51 | |
| 52 | function getDiff(oldUrls, oldDiff) { |
| 53 | res = {}; |
| 54 | |
| 55 | const oldPages = fs.readdirSync(path.join(__dirname, '../dist/lastExtension/content')) |
| 56 | .filter(el => el.startsWith('page_') && el.endsWith('.js')) |
| 57 | .map(el => el.replace('page_', '').replace('.js', '')) |
| 58 | |
| 59 | // Page urls |
| 60 | oldPages.forEach(page => { |
| 61 | try { |
| 62 | const urls = pagesUtils.urls(page); |
| 63 | const diffUrls = urls.match.filter(el => !oldUrls.includes(el)); |
| 64 | if (diffUrls.length) { |
| 65 | res[page] = diffUrls; |
| 66 | } |
| 67 | } catch (err) { |
| 68 | return |
| 69 | } |
| 70 | }); |
| 71 | |
| 72 | // Iframe urls |
| 73 | res['iframe'] = pagesUtils |
| 74 | .generateMatchExcludes(playerUrls) |
| 75 | .match.filter(el => !oldUrls.includes(el)); |
| 76 | |
| 77 | return res; |
| 78 | } |
| 79 | |
| 80 | function getUrls(manifest) { |
| 81 | const urls = []; |