コマンドラインからGoogle Chromeで現在開いているタブを取得する


18

すべてのタブをChromeからFirefoxに自動的に転送するシェルスクリプトを作成したい(Chromeからタブのリストを取得し、スクリプトでFirefoxで開くことにより)。GoogleChromeでは、リストを取得できますか。コマンドライン経由で開いているタブの?

回答:


7

この質問には答えられませんでした。上記の解決策は、OPがCLIで要求したChrome開発ツール用であるため、これは私が見つけた解決策です。

strings ~/'.config/chromium/Default/Current Session' | 'grep' -E '^https?://'


1

また、オープンソースユーティリティを使用することもできますchrome-cli。Homebrewでインストールできます:

brew install chrome-cli

また、READMEから1つ注意してください。

javascriptを実行するには、最初にそれを許可する必要がありますView > Developer > Allow JavaScript from Apple Events

これは次のようなものです。

$ chrome-cli list tabs
[1889] Edit - Super User
[1918] prasmussen/chrome-cli: Control Google Chrome from the command line
[1905] Yotto Winter Mix 19 by Yotto
$ chrome-cli list links
[1889] https://superuser.com/posts/1407956/edit
[1918] https://github.com/prasmussen/chrome-cli
[1905] https://soundcloud.com/yotto/yotto-winter-mix-2019
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.