Feat: 外部サイトからテーマ・プラグインのインストールができるように (#12034)
* Feat: 外部サイトからテーマ・プラグインのインストールができるように * Update Changelog * Change Changelog * Remove unnecessary imports * Update fetch-external-resources.ts * Update CHANGELOG.md * Update CHANGELOG.md
This commit is contained in:
		| @@ -31,23 +31,28 @@ import * as os from '@/os.js'; | ||||
| import { useTooltip } from '@/scripts/use-tooltip.js'; | ||||
| import { safeURIDecode } from '@/scripts/safe-uri-decode.js'; | ||||
|  | ||||
| const props = defineProps<{ | ||||
| const props = withDefaults(defineProps<{ | ||||
| 	url: string; | ||||
| 	rel?: string; | ||||
| }>(); | ||||
| 	showUrlPreview?: boolean; | ||||
| }>(), { | ||||
| 	showUrlPreview: true, | ||||
| }); | ||||
|  | ||||
| const self = props.url.startsWith(local); | ||||
| const url = new URL(props.url); | ||||
| if (!['http:', 'https:'].includes(url.protocol)) throw new Error('invalid url'); | ||||
| const el = ref(); | ||||
|  | ||||
| useTooltip(el, (showing) => { | ||||
| 	os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), { | ||||
| 		showing, | ||||
| 		url: props.url, | ||||
| 		source: el.value, | ||||
| 	}, {}, 'closed'); | ||||
| }); | ||||
| if (props.showUrlPreview) { | ||||
| 	useTooltip(el, (showing) => { | ||||
| 		os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), { | ||||
| 			showing, | ||||
| 			url: props.url, | ||||
| 			source: el.value, | ||||
| 		}, {}, 'closed'); | ||||
| 	}); | ||||
| } | ||||
|  | ||||
| const schema = url.protocol; | ||||
| const hostname = decodePunycode(url.hostname); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 かっこかり
					かっこかり