mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
20 lines
684 B
TypeScript
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);
|
|
}
|