Try   HackMD

於 Ubuntu 安裝 Line Chrome 擴充功能並建立捷徑

日期:2021/7/7
作者:王一哲

前言

我一開始是參考這篇文章〈在 Linux 上讓 Chrome 的 Line 擴充元件當作獨立運作程式執行〉,也在 Linux Mint 上成功地建立了快速啟動的按鈕,但是同樣的方法到了 Ubuntu 20.04 搭配 Gnome 3.36.8 卻無法使用,只會開啟 Chrome 瀏覽器並進到 chrome://extensions/ 分頁。經過一個下午的測試之後我終於找到一個可以成功運作的方法,以下是我的筆記。

安裝軟體並建立捷徑

首先,於文字界面中輸入以下指令安裝開放原始碼版本的 Chromium,目前自動安裝的版本是 91.0.4472.114。

sudo apt install chromium-browser

開啟 chromium-browser,進入 Chrome 線上應用程式商店,搜尋 Line 並安裝擴充功能。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Chromium

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Chrome 線上應用程式商店


安裝後回到 Chromium 視窗,點選右上角的 Line 圖示啟動擴充功能,再關閉 Line 擴充功能視窗。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

啟動 Line 擴充功能


回到 Chromium 視窗,點選右上角向下方的三角形圖示,再點選最近關閉的分頁中的Line

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

開啟最近關閉的分頁


依序點選右上角三個點的圖示更多工具建立捷徑

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Line 擴充功能分頁


桌面會出現一個名為 chrome-bkcocnplcbgblleikhafgdopcojdccbk-Default.desktop 的檔案,內容是

#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Terminal=false Type=Application Name=LINE Exec=/snap/chromium/1646/usr/lib/chromium-browser/chrome --profile-directory=Default --app-id=bkcocnplcbgblleikhafgdopcojdccbk Icon=chrome-bkcocnplcbgblleikhafgdopcojdccbk-Default StartupWMClass=crx_bkcocnplcbgblleikhafgdopcojdccbk

將這個檔案複製到 /home/[UserName]/.local/share/applications,並將 Icon 換成從網路上找到的 Line 圖示,假設檔名為 line.jpg,並將圖片放置在同一個資料夾裡,則 Icon 那一行改成這樣即可。

Icon=/home/[UserName]/.local/share/applications/line.jpg

現在應該可以在 Ubuntu 裡搜尋到 Line 應用程式。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

於 Ubuntu 中搜尋 Line


在 Line 應用程式圖示上按滑鼠右鍵,點選加入喜好就完成了。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

將 Line 加入喜好


結語

雖然找到了一個可以成功運作的方法,但是這個方法看起來還是很怪,希望可以找到更簡潔的作法。

參考資料



2021/7/19 補充

同樣的方法在 Brave 瀏覽器也能使用,畢竟它也是以 Chromium 為基礎發展而成的瀏覽器,同一招能夠成夠似乎也不意外。


tags:ComputerLinux