Code Monkey home page Code Monkey logo

chrome-cli's Introduction

chrome-cli

Overview

chrome-cli is a command line utility for controlling Google Chrome on OS X. It is a native binary that uses the Scripting Bridge to communicate with Chrome.

Installation

  • Save the 'chrome-cli' binary to a location in your PATH (i.e. /usr/local/bin/)

Downloads

Usage

chrome-cli -h  (Print help)
chrome-cli --help  (Print help)
chrome-cli help  (Print help)
chrome-cli list windows  (List all windows)
chrome-cli list tabs  (List all tabs)
chrome-cli list tabs -w <id>  (List tabs in specific window)
chrome-cli info  (Print info for active tab)
chrome-cli info -t <id>  (Print info for specific tab)
chrome-cli open <url>  (Open url in new tab)
chrome-cli open <url> -n  (Open url in new window)
chrome-cli open <url> -t <id>  (Open url in specific tab)
chrome-cli open <url> -w <id>  (Open url in new tab in specific window)
chrome-cli close  (Close active tab)
chrome-cli close -w  (Close active window)
chrome-cli close -t <id>  (Close specific tab)
chrome-cli close -w <id>  (Close specific window)
chrome-cli reload  (Reload active tab)
chrome-cli reload -t <id>  (Reload specific tab)
chrome-cli back  (Navigate back in active tab)
chrome-cli back -t <id>  (Navigate back in specific tab)
chrome-cli forward  (Navigate forward in active tab)
chrome-cli forward -t <id>  (Navigate forward in specific tab)
chrome-cli source  (Print source from active tab)
chrome-cli source -t <id>  (Print source from specific tab)
chrome-cli execute <javascript>  (Execute javascript in active tab)
chrome-cli execute <javascript> -t <id>  (Execute javascript in specific tab)
chrome-cli chrome version  (Print Chrome version)

Examples

List tabs
$ chrome-cli list tabs
[57] Inbox (1) - [email protected] - Gmail
[2147] My Drive - Google Drive
[2151] GitHub
[2161]
[2155] Hacker News
Print tab info
$ chrome-cli info -t 2161
Id: 2162
Title:
Url: http://httpbin.org/ip
Loading: No
Print tab source
$ chrome-cli source -t 2161
<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">{
  "origin": "1.2.3.4"
}</pre></body></html>
Extract information from page
$ chrome-cli execute '(function() { var nodes = document.querySelectorAll(".title a"); var titles = []; for (var i = 0; i < 5; i++) { titles.push(nodes[i].innerHTML) } return titles.join("\n"); })();' -t 2155
High-Speed Trading Isn't About Efficiency—It's About Cheating
The terrifying surveillance case of Brandon Mayfield
Google turns on "Download Gmail Archive" feature
Learning to Code vs Learning Computer Science
Show HN: Crushify.org

chrome-cli's People

Contributors

prasmussen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.