This commit is contained in:
kakkokari-gtyih 2024-06-02 20:18:48 +09:00
parent 7a1e28d674
commit d90f84d24f
1 changed files with 5 additions and 3 deletions

View File

@ -51,13 +51,15 @@ provideMetadataReceiver((metadataGetter) => {
provideReactiveMetadata(pageMetadata); provideReactiveMetadata(pageMetadata);
//#region Embed Link Behavior //#region Embed Link Behavior
//
//
mainRouter.navHook = (path, flag): boolean => { mainRouter.navHook = (path, flag): boolean => {
window.open(path, '_blank', 'noopener'); window.open(path, '_blank', 'noopener');
return true; return true;
}; };
//#endregion
//#region Embed Provide
provide('EMBED_PAGE', true);
//#endregion //#endregion
//#region Embed Style //#region Embed Style
@ -74,7 +76,7 @@ let resizeMessageThrottleFlag = false;
let previousHeight = 0; let previousHeight = 0;
const resizeObserver = new ResizeObserver(async () => { const resizeObserver = new ResizeObserver(async () => {
const height = rootEl.value!.scrollHeight + 2; // border 1px const height = rootEl.value!.scrollHeight + 2; // border 1px
if (resizeMessageThrottleFlag && Math.abs(previousHeight - height) < 30) return; if (resizeMessageThrottleFlag && Math.abs(previousHeight - height) < 30) return; // 30px
if (resizeMessageThrottleTimer) window.clearTimeout(resizeMessageThrottleTimer); if (resizeMessageThrottleTimer) window.clearTimeout(resizeMessageThrottleTimer);
postMessageToParentWindow('misskey:embed:changeHeight', { postMessageToParentWindow('misskey:embed:changeHeight', {