Files
BewlyBewly/src/logic/common-setup.ts
Hakadao 303f372363 feat: update video page
feat: limit the page width with `--bew-page-max-width`
2023-02-22 00:16:43 +08:00

17 lines
629 B
TypeScript

import type { App } from 'vue'
import { getCurrentContext } from 'webext-bridge'
export function setupApp(app: App) {
const context = getCurrentContext()
// Inject a globally available `$app` object in template
app.config.globalProperties.$app = { context }
// Provide access to `app` in script setup with `const app = inject('app')`
app.provide('app', app.config.globalProperties.$app)
// Here you can install additional plugins for all contexts: popup, options page and content-script.
// example: app.use(i18n)
// example excluding content-script context: if (context !== 'content-script') app.use(i18n)
}