| import { StylesheetAttributes, injectStylesheet } from './contentScriptsUtils'; |
| export default class StylesheetManager { |
| private injectedElement: HTMLElement; |
| * Relative path to the stylesheet from the extension root. |
| public stylesheet: string, |
| * Attributes to include in the injected <link> element. |
| public attributes: StylesheetAttributes = {}, |
| return this.injectedElement !== undefined; |
| this.injectedElement = injectStylesheet( |
| chrome.runtime.getURL(this.stylesheet), |
| this.injectedElement.remove(); |
| this.injectedElement = undefined; |