This commit is contained in:
parent
2a3d7f1b7e
commit
efbb7c0b11
5 changed files with 14 additions and 9 deletions
|
@ -7,7 +7,8 @@
|
|||
"scripts": {
|
||||
"dev": "pnpm -r --parallel dev",
|
||||
"build": "tsc -b && pnpm -r build",
|
||||
"build:vendor": "cd vendor && bash build-patched-chobitsu.sh"
|
||||
"build:vendor": "cd vendor && bash build-patched-chobitsu.sh",
|
||||
"preview": "pnpm run -r --parallel preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^3.13.0",
|
||||
|
|
|
@ -48,6 +48,12 @@ const HTML = `
|
|||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
.tabbed-pane-left-toolbar,
|
||||
.tabbed-pane-right-toolbar,
|
||||
.tabbed-pane-tab-slider,
|
||||
.tabbed-pane-header-tab:not(#tab-console, #tab-sources) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
`
|
||||
|
||||
|
@ -89,10 +95,6 @@ async function focusConsole(tabbedPane) {
|
|||
|
||||
const tabbedPane = await waitForElement('.tabbed-pane', document.body);
|
||||
await focusConsole(tabbedPane);
|
||||
|
||||
await waitForElement('.tabbed-pane-right-toolbar', tabbedPane.shadowRoot);
|
||||
hideBySelectorAll(tabbedPane.shadowRoot, '.tabbed-pane-left-toolbar, .tabbed-pane-right-toolbar, .tabbed-pane-tab-slider');
|
||||
hideBySelectorAll(tabbedPane.shadowRoot, '.tabbed-pane-header-tab:not(#tab-console, #tab-sources)');
|
||||
tabbedPane.shadowRoot.appendChild(document.querySelector('#inject-css-tab-pane'));
|
||||
|
||||
const consoleToolbar = await waitForElement('.console-main-toolbar', document.body);
|
||||
|
|
|
@ -13,6 +13,9 @@ export default defineConfig((env): UserConfig => {
|
|||
optimizeDeps: {
|
||||
exclude: ['@mtcute/wasm'],
|
||||
},
|
||||
preview: {
|
||||
port: 3000,
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
external: ['node:fs/promises', 'node:crypto'],
|
||||
|
|
|
@ -9,10 +9,6 @@ if (!window.parent || window.parent === window) {
|
|||
throw new Error('Not in iframe')
|
||||
}
|
||||
|
||||
if (new URL(document.referrer).origin !== import.meta.env.VITE_HOST_ORIGIN) {
|
||||
throw new Error(`Invalid origin: this page must be loaded in an iframe from ${import.meta.env.VITE_HOST_ORIGIN}`)
|
||||
}
|
||||
|
||||
const worker = new ReplWorker()
|
||||
|
||||
registerWorker(worker)
|
||||
|
|
|
@ -12,6 +12,9 @@ export default defineConfig((env): UserConfig => {
|
|||
server: {
|
||||
port: 3001,
|
||||
},
|
||||
preview: {
|
||||
port: 3001,
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ['@mtcute/wasm'],
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue