(obj)
| 270 | if (fs.existsSync(manifestPath)) { |
| 271 | const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); |
| 272 | const checkManifestField = (obj) => { |
| 273 | if (typeof obj === 'string' && /\.(js|css|png|jpg|jpeg|gif|svg)$/i.test(obj)) { |
| 274 | const normalizedPath = obj.startsWith('/') ? obj.slice(1) : obj; |
| 275 | if (!shouldExcludeFile(normalizedPath)) { |
| 276 | referencedFiles.add(normalizedPath); |
| 277 | } |
| 278 | } else if (Array.isArray(obj)) { |
| 279 | obj.forEach(item => checkManifestField(item)); |
| 280 | } else if (typeof obj === 'object' && obj !== null) { |
| 281 | Object.values(obj).forEach(value => checkManifestField(value)); |
| 282 | } |
| 283 | }; |
| 284 | if (manifest.content_scripts) { |
| 285 | manifest.content_scripts.forEach(script => { |
| 286 | if (script.js) { |
no test coverage detected