forked from mirror/misskey
navhookをbootに移動
This commit is contained in:
parent
15443e4418
commit
6f802477c3
@ -14,6 +14,7 @@ import type { CommonBootOptions } from '@/boot/common.js';
|
|||||||
import { setIframeId, postMessageToParentWindow } from '@/scripts/post-message.js';
|
import { setIframeId, postMessageToParentWindow } from '@/scripts/post-message.js';
|
||||||
import { parseEmbedParams } from '@/scripts/embed-page.js';
|
import { parseEmbedParams } from '@/scripts/embed-page.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
import { useRouter } from '@/router/supplier.js';
|
||||||
|
|
||||||
const bootOptions: Partial<CommonBootOptions> = {};
|
const bootOptions: Partial<CommonBootOptions> = {};
|
||||||
|
|
||||||
@ -61,6 +62,15 @@ common(() => createApp(
|
|||||||
defaultStore.set('sound_notUseSound', true);
|
defaultStore.set('sound_notUseSound', true);
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region Embed Link Behavior
|
||||||
|
//強制的に新しいタブで開く
|
||||||
|
const router = useRouter();
|
||||||
|
router.navHook = (path, flag): boolean => {
|
||||||
|
window.open(path, '_blank', 'noopener');
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
|
||||||
// 起動完了を通知(このあとクライアント側から misskey:embedParent:registerIframeId が送信される)
|
// 起動完了を通知(このあとクライアント側から misskey:embedParent:registerIframeId が送信される)
|
||||||
postMessageToParentWindow('misskey:embed:ready');
|
postMessageToParentWindow('misskey:embed:ready');
|
||||||
});
|
});
|
||||||
|
@ -55,14 +55,6 @@ provideMetadataReceiver((metadataGetter) => {
|
|||||||
});
|
});
|
||||||
provideReactiveMetadata(pageMetadata);
|
provideReactiveMetadata(pageMetadata);
|
||||||
|
|
||||||
//#region Embed Link Behavior
|
|
||||||
//強制的に新しいタブで開く
|
|
||||||
mainRouter.navHook = (path, flag): boolean => {
|
|
||||||
window.open(path, '_blank', 'noopener');
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
//#region Embed Style
|
//#region Embed Style
|
||||||
const embedRounded = ref(embedParams.rounded);
|
const embedRounded = ref(embedParams.rounded);
|
||||||
const embedNoBorder = ref(!embedParams.border);
|
const embedNoBorder = ref(!embedParams.border);
|
||||||
|
Loading…
Reference in New Issue
Block a user