diff --git a/packages/frontend-embed/src/style.scss b/packages/frontend-embed/src/style.scss index 02b09633e7..b5cb394114 100644 --- a/packages/frontend-embed/src/style.scss +++ b/packages/frontend-embed/src/style.scss @@ -127,7 +127,9 @@ rt { } ._button { - @extend ._noSelect; + user-select: none; + -webkit-user-select: none; + -webkit-touch-callout: none; appearance: none; display: inline-block; padding: 0; diff --git a/packages/frontend/src/_dev_boot_.ts b/packages/frontend/src/_dev_boot_.ts index 907e5ce7e7..7c6e537fbc 100644 --- a/packages/frontend/src/_dev_boot_.ts +++ b/packages/frontend/src/_dev_boot_.ts @@ -7,15 +7,10 @@ // よって、devモードとして起動されるときはビルド時に組み込む形としておく。 // (pnpm start時はpugファイルの中で静的リソースとして読み込むようになっており、この問題は起こっていない) import '@tabler/icons-webfont/dist/tabler-icons.scss'; -import { embedPage } from '@/config.js'; await main(); -if (embedPage) { - import('@/_embed_boot_.js'); -} else { - import('@/_boot_.js'); -} +import('@/_boot_.js'); /** * backend/src/server/web/boot.jsで差し込まれている起動処理のうち、最低限必要なものを模倣するための処理 diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index e9e2b60387..fb1d8e9a44 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -14,7 +14,6 @@ import { apiUrl } from '@/config.js'; import { waiting, popup, popupMenu, success, alert } from '@/os.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js'; -import { embedPage } from '@/config.js'; // TODO: 他のタブと永続化されたstateを同期 @@ -23,7 +22,6 @@ type Account = Misskey.entities.MeDetailed & { token: string }; const accountData = miLocalStorage.getItem('account'); function initAccount() { - if (embedPage) return null; if (accountData) return reactive(JSON.parse(accountData) as Account); return null; } @@ -85,14 +83,10 @@ export async function signout() { } export async function getAccounts(): Promise<{ id: Account['id'], token: Account['token'] }[]> { - if (embedPage) return []; - return (await get('accounts')) || []; } export async function addAccount(id: Account['id'], token: Account['token']) { - if (embedPage) return; - const accounts = await getAccounts(); if (!accounts.some(x => x.id === id)) { await set('accounts', accounts.concat([{ id, token }])); @@ -194,8 +188,6 @@ export async function refreshAccount() { } export async function login(token: Account['token'], redirect?: string) { - if (embedPage) return; - const showing = ref(true); const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkWaitingDialog.vue')), { success: false, diff --git a/packages/frontend/src/instance.ts b/packages/frontend/src/instance.ts index 0067543411..6847321d6c 100644 --- a/packages/frontend/src/instance.ts +++ b/packages/frontend/src/instance.ts @@ -8,7 +8,6 @@ import * as Misskey from 'misskey-js'; import { misskeyApi } from '@/scripts/misskey-api.js'; import { miLocalStorage } from '@/local-storage.js'; import { DEFAULT_INFO_IMAGE_URL, DEFAULT_NOT_FOUND_IMAGE_URL, DEFAULT_SERVER_ERROR_IMAGE_URL } from '@/const.js'; -import { embedPage } from '@/config.js'; // TODO: 他のタブと永続化されたstateを同期 @@ -37,7 +36,7 @@ export const infoImageUrl = computed(() => instance.infoImageUrl ?? DEFAULT_INFO export const notFoundImageUrl = computed(() => instance.notFoundImageUrl ?? DEFAULT_NOT_FOUND_IMAGE_URL); -export const isEnabledUrlPreview = computed(() => (instance.enableUrlPreview ?? true) && !embedPage); +export const isEnabledUrlPreview = computed(() => instance.enableUrlPreview ?? true); export async function fetchInstance(force = false): Promise { if (!force) { diff --git a/packages/frontend/src/scripts/idb-proxy.ts b/packages/frontend/src/scripts/idb-proxy.ts index a3e81da733..20f51660c7 100644 --- a/packages/frontend/src/scripts/idb-proxy.ts +++ b/packages/frontend/src/scripts/idb-proxy.ts @@ -10,7 +10,6 @@ import { set as iset, del as idel, } from 'idb-keyval'; -import { embedPage } from '@/config.js'; import { miLocalStorage } from '@/local-storage.js'; const PREFIX = 'idbfallback::'; @@ -27,10 +26,7 @@ if (window.Cypress) { console.log('Cypress detected. It will use localStorage.'); } -if (embedPage) { - idbAvailable = false; - console.log('Embed page detected. It will use safeSessionStorage.'); -} else if (idbAvailable) { +if (idbAvailable) { await iset('idb-test', 'test') .catch(err => { console.error('idb error', err); diff --git a/packages/frontend/src/scripts/please-login.ts b/packages/frontend/src/scripts/please-login.ts index 93db66fe43..5a28852245 100644 --- a/packages/frontend/src/scripts/please-login.ts +++ b/packages/frontend/src/scripts/please-login.ts @@ -7,7 +7,6 @@ import { defineAsyncComponent, inject } from 'vue'; import { $i } from '@/account.js'; import { i18n } from '@/i18n.js'; import { popup } from '@/os.js'; -import { embedPage } from '@/config.js'; export type OpenOnRemoteOptions = { /** @@ -48,22 +47,18 @@ export type OpenOnRemoteOptions = { export function pleaseLogin(path?: string, openOnRemote?: OpenOnRemoteOptions) { if ($i) return; - if (embedPage) { - window.open(path ?? '/', '_blank', 'noopener'); - } else { - const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), { - autoSet: true, - message: openOnRemote ? i18n.ts.signinOrContinueOnRemote : i18n.ts.signinRequired, - openOnRemote, - }, { - cancelled: () => { - if (path) { - window.location.href = path; - } - }, - closed: () => dispose(), - }); - } + const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), { + autoSet: true, + message: openOnRemote ? i18n.ts.signinOrContinueOnRemote : i18n.ts.signinRequired, + openOnRemote, + }, { + cancelled: () => { + if (path) { + window.location.href = path; + } + }, + closed: () => dispose(), + }); throw new Error('signin required'); } diff --git a/packages/frontend/src/scripts/theme.ts b/packages/frontend/src/scripts/theme.ts index 4075cb36a5..c7f8b3d596 100644 --- a/packages/frontend/src/scripts/theme.ts +++ b/packages/frontend/src/scripts/theme.ts @@ -11,7 +11,6 @@ import { globalEvents } from '@/events.js'; import lightTheme from '@/themes/_light.json5'; import darkTheme from '@/themes/_dark.json5'; import { miLocalStorage } from '@/local-storage.js'; -import { embedPage } from '@/config.js'; export type Theme = { id: string; @@ -96,9 +95,7 @@ export function applyTheme(theme: Theme, persist = true) { document.documentElement.style.setProperty(`--${k}`, v.toString()); } - if (!embedPage) { - document.documentElement.style.setProperty('color-scheme', colorScheme); - } + document.documentElement.style.setProperty('color-scheme', colorScheme); if (persist) { miLocalStorage.setItem('theme', JSON.stringify(props)); diff --git a/packages/frontend/src/stream.ts b/packages/frontend/src/stream.ts index 41b2a29b68..5b6460ed60 100644 --- a/packages/frontend/src/stream.ts +++ b/packages/frontend/src/stream.ts @@ -7,8 +7,7 @@ import * as Misskey from 'misskey-js'; import { markRaw } from 'vue'; import { $i } from '@/account.js'; import { wsOrigin } from '@/config.js'; -import { StreamMock } from '@/scripts/stream-mock.js'; -import { embedPage } from '@/config.js'; +//import { StreamMock } from '@/scripts/stream-mock.js'; // heart beat interval in ms const HEART_BEAT_INTERVAL = 1000 * 60; @@ -21,14 +20,9 @@ export function useStream(): Misskey.IStream { if (stream) return stream; // TODO: No Websocketモードもここで判定 - if (embedPage) { - stream = markRaw(new StreamMock(wsOrigin, null)); - return stream; - } else { - stream = markRaw(new Misskey.Stream(wsOrigin, $i ? { - token: $i.token, - } : null)); - } + stream = markRaw(new Misskey.Stream(wsOrigin, $i ? { + token: $i.token, + } : null)); if (timeoutHeartBeat) window.clearTimeout(timeoutHeartBeat); timeoutHeartBeat = window.setTimeout(heartbeat, HEART_BEAT_INTERVAL);