import browser from 'webextension-polyfill'; import {html} from 'htm/preact'; import {Component, render} from 'preact'; window.addEventListener('DOMContentLoaded', () => { console.debug('Options page opened!'); render(html`<${OptionsPage} />`, document.body); }); class OptionsPage extends Component { render() { const manifest = browser.runtime.getManifest(); const tableRows = [ ['Name', manifest.name], ['Description', manifest.description], ['Version', manifest.version], ['Mode', import.meta.env.MODE], ].map( ([key, value]) => html` ${key} ${value} `, ); const permissions = manifest.permissions?.map( (permission) => html`
  • ${permission}
  • `, ); return html`

    Manifest Info

    ${tableRows}

    Permissions

    `; } }