your personal website on atproto - mirror blento.app

fix security

Florian 34b8191b e81420fd

+34 -3
+1 -1
src/lib/cards/EmbedCard/EmbedCard.svelte
··· 6 6 7 7 <iframe 8 8 src={item.cardData.href} 9 - sandbox="allow-scripts allow-same-origin" 9 + sandbox="allow-scripts" 10 10 referrerpolicy="no-referrer" 11 11 class="absolute inset-0 h-full w-full" 12 12 title=""
+25
src/lib/cards/LivestreamCard/LivestreamEmbedCard.svelte
··· 1 + <script lang="ts"> 2 + import type { ContentComponentProps } from '../types'; 3 + 4 + let { 5 + item, 6 + sandbox 7 + }: ContentComponentProps & { 8 + sandbox: string; 9 + } = $props(); 10 + 11 + // svelte-ignore state_referenced_locally 12 + let domain = new URL(item.cardData.href).hostname; 13 + </script> 14 + 15 + {#if domain === 'stream.place'} 16 + <iframe 17 + src={item.cardData.href} 18 + sandbox="allow-scripts allow-same-origin" 19 + referrerpolicy="no-referrer" 20 + class="absolute inset-0 h-full w-full" 21 + title="" 22 + ></iframe> 23 + {:else} 24 + <div class="p-4">Invalid domain</div> 25 + {/if}
+2 -1
src/lib/cards/LivestreamCard/index.ts
··· 4 4 import EmbedCard from '../EmbedCard/EmbedCard.svelte'; 5 5 import type { CardDefinition } from '../types'; 6 6 import LivestreamCard from './LivestreamCard.svelte'; 7 + import LivestreamEmbedCard from './LivestreamEmbedCard.svelte'; 7 8 import SidebarItemEmbedLivestreamCard from './SidebarItemEmbedLivestreamCard.svelte'; 8 9 import SidebarItemLivestreamCard from './SidebarItemLivestreamCard.svelte'; 9 10 ··· 68 69 69 70 export const LivestreamEmbedCardDefitition = { 70 71 type: 'livestreamEmbed', 71 - contentComponent: EmbedCard, 72 + contentComponent: LivestreamEmbedCard, 72 73 sidebarComponent: SidebarItemEmbedLivestreamCard, 73 74 createNew: (card) => { 74 75 card.w = 2;
+6 -1
todo.md
··· 14 14 - social accounts card (multiple) 15 15 - cartoons: aka https://www.opendoodles.com/ 16 16 - excalidraw 17 - - map 17 + - [x] map 18 18 - [x] youtube video 19 19 - youtube channel 20 20 - guestbook ··· 28 28 - smoke signal 29 29 - statusphere.xyz 30 30 - add some caching to user data 31 + 32 + - other fun card ideas: 33 + - svader 34 + - zdog 35 + - tixy 31 36 32 37 - image cards: different images for dark and light mode 33 38