Files
BetterSEQTA-Plus/src/seqta/ui/ImageBackgrounds.ts
T
2024-03-24 09:45:27 +11:00

20 lines
684 B
TypeScript

import browser from 'webextension-polyfill';
import { SettingsState } from '../../types/storage';
import backgroundURL from './background/background.html?url'
export async function appendBackgroundToUI() {
const settings = await browser.storage.local.get() as SettingsState;
if (settings.theme == '') return;
const parent = document.getElementById('container');
// embed background.html
const background = document.createElement('iframe');
background.id = 'background';
background.classList.add('imageBackground');
background.setAttribute('excludeDarkCheck', 'true');
background.src = browser.runtime.getURL(backgroundURL);
parent!.appendChild(background);
}