Ghosteryをgitから動かす

2020年1月24日金曜日

Linux ブラウザ拡張

t f B! P L
プライバシー広告ブロッカーGhosteryのソースコードをgitから取得して動かしてみました。動作環境はUbuntu 18.04.1 LTSです。

手順

まず、ソースをgitから取得します。

$git clone https://github.com/ghostery/ghostery-extension.git
あとは、gitサイトに記載の通り、以下のコマンドを実行します。

$cd ghostery-extension
$yarn install --frozen-lockfile
$yarn upgrade
$yarn build.dev
$yarn build.prod

起動

ghostery-extension内で、web-extを使ってfirefoxを起動します。

$sudo npm install --global web-ext
$web-ext run
Ghosteryが組み込まれたfirefoxが起動します。
Ghosteryを組み込んだfirefox

yarnのエラー

ubuntuで最初にyarnを実行すると、次のようなエラーが出ました。

$ yarn install --frozen-lockfile
Command 'yarn' not found, but can be installed with:
sudo apt install cmdtest
エラー表示のアドバイスに素直に従ってcmdtestをインストールして、再度yarnを実行すると、次のようなエラーが。

$yarn install --frozen-lockfile
Usage: yarn [options]

yarn: error: no such option: --frozen-lockfile
どうも、これは既知の問題のようで、cmdtestをインストールしてはいけないようです。cmdtestをアンインストールした後、yarnの公式サイトの説明に従ってyarnをインストールすると、エラーがなくなりました。

$sudo apt remove cmdtest
$curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
$echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
$sudo apt-get update && sudo apt-get install yarn

このブログを検索

ブログアーカイブ

QooQ