kssfilo / safari-ctl

A Command line tool to control Safari for MacOS. (Browsing/FillingForm/GetSetCopyURL/JavascriptInjection/GetTitle/Search)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

safari-ctl - Command Line Tool To Control Safari for MacOS

A Command Line Tool to Control Safari for MacOS. (Browsing/FillingForm/GetSetCopyURL/JavascriptInjection/GetTitle/Search)

### Get current URL on Safari

$ safari-ctl
https://github.com

### Copy current URL on Safari to the clipboard

$ safari-ctl -s

### Navigating by command line

$ safari-ctl -m
# marks all <a> with numbers

$ safari-ctl -a 32
# click 32'th <a>

$ safari-ctl -b
# history back

### Filing form

$ safari-ctl -M
# marks all <input> with numbers

$ safari-ctl -A 0 -I 'Japan'
# Fill 0th input with 'Japan'

$ safari-ctl -A 1
# click 1st input button

### Javascript Injection

$  safari-ctl -j 'document.getElementById("sb_form_q").value="Japan"'
Japan

Install

npm i -g safari-ctl

You must enable the 'Allow JavaScript from Apple Events' option in Safari's Develop menu to use some features.

@PARTPIPE@|dist/cli.js -h

You can see detail usage on npmjs.com

@PARTPIPE@

Change Log

  • 0.1.x: beta release
  • 0.2.0: suppress result at anchor click/history forward/scroll

Idea

  • marking buttons

About

A Command line tool to control Safari for MacOS. (Browsing/FillingForm/GetSetCopyURL/JavascriptInjection/GetTitle/Search)

License:MIT License


Languages

Language:CoffeeScript 74.8%Language:Makefile 18.1%Language:Shell 7.1%