({
profilePath,
modulesPath,
options = {},
enabled = [],
})
| 5 | import { join } from "path"; |
| 6 | |
| 7 | export default function handle({ |
| 8 | profilePath, |
| 9 | modulesPath, |
| 10 | options = {}, |
| 11 | enabled = [], |
| 12 | }) { |
| 13 | let out = `/* ${defaultPrefs.preamble} */\n\n\n`; |
| 14 | |
| 15 | for (let p of enabled) { |
| 16 | log.debug(`usercss: Enabling module ${p}`); |
| 17 | copyFilesToProfile(join(profilePath, "chrome", "content_css_files"), [ |
| 18 | join(modulesPath, p), |
| 19 | ]); |
| 20 | } |
| 21 | copyFilesToProfile(join(profilePath, "chrome"), [ |
| 22 | { |
| 23 | name: "userContent.css", |
| 24 | append: true, |
| 25 | content: |
| 26 | `/* ${defaultPrefs.preamble} */\n\n` + |
| 27 | enabled |
| 28 | .map( |
| 29 | (i) => |
| 30 | `@import url(${JSON.stringify(`content_css_files/${i}`)});` |
| 31 | ) |
| 32 | .join("\n"), |
| 33 | }, |
| 34 | ]); |
| 35 | } |
nothing calls this directly
no test coverage detected