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