| @@ -42,22 +42,26 @@ export default (({ post }: Props) => { | |||||
| const [framed, setFramed] = useState (false) | const [framed, setFramed] = useState (false) | ||||
| return <>{ | |||||
| framed | |||||
| ? ( | |||||
| <iframe | |||||
| src={post.url} | |||||
| title={post.title || post.url} | |||||
| width={640} | |||||
| height={360}/>) | |||||
| : ( | |||||
| <a href="#" onClick={e => { | |||||
| e.preventDefault () | |||||
| setFramed (confirm ('未確認の外部ページを表示します。\n' | |||||
| + '悪意のあるスクリプトが実行される可能性があります。\n' | |||||
| + '表示しますか?')) | |||||
| return | |||||
| }}> | |||||
| 外部ページを表示 | |||||
| </a>)}</> | |||||
| return ( | |||||
| <> | |||||
| {framed | |||||
| ? ( | |||||
| <iframe | |||||
| src={post.url} | |||||
| title={post.title || post.url} | |||||
| width={640} | |||||
| height={360}/>) | |||||
| : ( | |||||
| <div> | |||||
| <a href="#" onClick={e => { | |||||
| e.preventDefault () | |||||
| setFramed (confirm ('未確認の外部ページを表示します。\n' | |||||
| + '悪意のあるスクリプトが実行される可能性があります。\n' | |||||
| + '表示しますか?')) | |||||
| return | |||||
| }}> | |||||
| 外部ページを表示 | |||||
| </a> | |||||
| </div>)} | |||||
| </>) | |||||
| }) satisfies FC<Props> | }) satisfies FC<Props> | ||||