# 將 GoogleDrive 分享連結 to 圖片連結
- 範例輸入格式
https://drive.google.com/file/d/1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4/view?usp=sharing
`2023/04/22發現有新版 是 /view?usp=share_link 結尾`
https://drive.google.com/file/d/1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4/view?usp=share_link
1
2
3
4
2
3
4
- 範例輸出格式
https://drive.google.com/thumbnail?id=1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4&sz=w1366
1
作品
操作方式
1.點輸入框, 貼上連結
2.點產生圖片 URL 的按鈕
3.點複製按鈕複製結果(連結) => 拿去貼上做使用
1
2
3
4
5
2
3
4
5
# 圖片使用教學

1
<img
width="50px"
src="https://drive.google.com/thumbnail?id=1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4&sz=w1366"
/>
1
2
3
4
2
3
4
成果圖
# 參考資料
那些被忽略但很好用的 Web API / Clipboardopen in new window
How TO - Copy Text to Clipboardopen in new window
# 我學到什麼
# 複習了
- HTMLInputElement.select(); //可以選擇文字
- HTMLInputElement.focus() //可以 focus 在輸入框
# 第一次知道了
- Document.execCommand()語法 mdnopen in new window
文件說這個是已經過時的語法,我覺得好處是不用請求使用者同意(但有資安疑慮),比較現代的寫法是用Clipboard
API
- HTMLInputElement.setSelectionRange() //可以從被 focused 的 input 元素選取特定範圍