Code Monkey home page Code Monkey logo

chrome-cli's People

Contributors

andypiper avatar erikus avatar jarvys avatar k-ueki avatar omgitsads avatar prasmussen avatar skatsuya avatar tutamkhamon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chrome-cli's Issues

Number before tabs/windows names?

Hi! I'm wondering the meaning of the number (inside square brackets) before tabs/windows names when I run chrome-cli list tabs/chrome-cli list windows. Like this:

[416:429] Wrapify Is A Startup Paying Drivers To Wrap Their Car In Ads | TechCrunch
[416:431] 5 Books That Explain the Evolution of the English Language - Grammarly Blog | Grammarly Blog
[416:433] When chemical cues disappear, ants rely on memory | Science | AAAS
[435:438] The Number Of College Students Seeking Mental Health Treatment Is Growing Rapidly
[435:440] Robots can now defend themselves against our flying kicks - Quartz

or this:

[292] Why Growth Mindsets Are Necessary to Save Math Class - The Atlantic
[357] Star Wars Galaxies and The Matrix Online: When Video-Game Worlds End - The Atlantic
[372] This Millennial Might Be the New Einstein | Rising Stars | OZY
[377] The Video Game Helmet That Can Hack Your Brain | Motherboard
[382] Thync - Wikipedia, the free encyclopedia

Crash on first-tab

  1. Trying to launch new chrome instance with 'chrome-cli open' works fine, but it spews error message.

  2. Trying to open new chrome tab on chrome instance without any tab open doesn't work and just dump the same error message like 1).

2014-02-16 10:57:12.978 chrome-cli[3136:507] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '* -[SBProxyByClass setURL:]: object has not been added to a container yet; selector not recognized [self = 0x7fa1ea869180]'

Bring window to foreground

Activating a tab does activate it, but it will leave the window in the background if that's where it was. While there might be a case for that, it seems more likely that the window should be brought to the foreground. As an alternative, maybe this could be a separate command.

Bonus points if it can also switch desktop spaces on Mac OSX.

Arch Linux Package

I am going to submit this to the Arch Linux AUR. Can you provide a link to a MD5 or SHA1 version of the latest release for integrity checks?

Add option to save as pdf

Not sure if this is possible, but could we print a page in the tab by saving it to a pdf file?, Currently I can "Save as PDF" in the chrome print dialog, I want to save this exact version (with the formatting applied by chrome) to a PDF file.

Would be super useful if possible!

Is it possible to reload extensions?

Having the ability to reload custom extensions or apps, would make the workflow so much better.

For example, I'm using yeoman's chrome extension generator that comes with a grunt build task. The task builds and packages the extension, but I have to deploy it manually every time.

crashes in macOS 10.14 mojave

$ chrome-cli info
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[SBProxyByCode activeTab]: object has not been added to a container yet; selector not recognized [self = 0x7fdb1bc08280]'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff32767571 __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff5e718efb objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff327673a3 +[NSException raise:format:] + 193
	3   CoreFoundation                      0x00007fff327067fe ___forwarding___ + 1468
	4   CoreFoundation                      0x00007fff327061b8 _CF_forwarding_prep_0 + 120
	5   chrome-cli                          0x000000010245f846 -[App activeTab] + 48
	6   chrome-cli                          0x000000010245f44e -[App printSourceFromActiveTab:] + 20
	7   chrome-cli                          0x0000000102460d3b -[Handler call:] + 416
	8   chrome-cli                          0x0000000102460361 -[Argonaut run] + 85
	9   chrome-cli                          0x000000010246141b main + 1449
	10  libdyld.dylib                       0x00007fff5f7df085 start + 1
	11  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

most command+control commands fail with this error
chrome-cli list commands exit with no output

NSInvalidArgumentException

I'm experiencing following abnormal termination, but everything except the error message seems to be fine.

mbp:Downloads deif$ chrome-cli execute '1'
2014-02-15 23:38:08.011 chrome-cli[593:507] -[**NSCFNumber UTF8String]: unrecognized selector sent to instance 0x127
2014-02-15 23:38:08.012 chrome-cli[593:507] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber UTF8String]: unrecognized selector sent to instance 0x127'
* First throw call stack:
(
0 CoreFoundation 0x00007fff8b08f41c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff891b5e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8b0922ed -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff8afed5b2 __forwarding
+ 1010
4 CoreFoundation 0x00007fff8afed138 _CF_forwarding_prep_0 + 120
5 chrome-cli 0x000000010a6b59ee -[App executeJavascriptInActiveTab:] + 142
6 chrome-cli 0x000000010a6b6b62 -[Handler call:] + 401
7 chrome-cli 0x000000010a6b64cb -[Argonaut parse] + 511
8 chrome-cli 0x000000010a6b7176 main + 1244
9 libdyld.dylib 0x00007fff8a98d5fd start + 1

Pinned tabs

Is it possible to use this to open a new tab that's pinned?

Windows version

Thanks for your tool.
Any project of compiling one version for windows ?

provide a way to get back the window mode - incognito/normal

I can see that it's there in the applescript dictionary (as mode) so I presume this is possible.

My use case is that I have links that shouldn't be opened incognito, as they use authentication I only have in my 'normal' windows. So I want to script around those to get the best possible 'normal' window - using the active window if possible, or find a window to activate, or open a new window as a last resort.

Without being able to detect this, opening new windows each time is the only option.

Is it possible to get user names of the users that own the windows

Is it possible to make the output of chrome-cli list windows to include the user names? I use multiple users on chrome to keep my work links and browsing separate from my personal and I'd like to be able to open a url from the command line in a specific window.

Current output of chrome-cli list windows:

[24] New Issue · prasmussen/chrome-cli
[515] ☾ Alfred App - Productivity App for Mac OS X

Or are the window id's persistent across sessions?

feature request: move tabs to another window

Do you think it would be possible to add a feature to move/rearrange tabs between windows? And also move an existing tab to a new window.

Something like

chrome-cli move -t <id> -w <id> and chrome-cli move -t <id> respectively?

Resize window

Feature request: Anyway to add something like;

chrome-cli window resize w h
chrome-cli tab -t ID resize w h

??

Homebrew Formula

It would be nice if people can install this by just brew install chrome-cli.

`open` needs protocol to work, otherwise opens blank tab

chrome-cli open google.com results in a new tab with "about:blank" in the title bar.
chrome-cli open www.google.com also does exactly the same.
but chrome-cli open http://google.com or chrome-cli open http://www.google.com works as expected.
Can you make it so that the http:// protocol is optional? If we need a different protocol we can type that in instead.
Thanks

Activate specific window

Hello @prasmussen. Thanks for the great cli!

Is it possible to activate a specific window based on its ID? The cli command list doesn't show anything as far as I can tell.

Reload reloads the devtools window if it is the foremost tab

If you have an undocked devtools window, and use the reload command, the HTML in the devtools window will reload, but not the actual page attached to it. I'm not sure if this is a limitation of the Chrome APIs. If you use the GUI, pressing Command+R in the detached devtools reloads the page.

Feature request: support linux

Thanks a lot for this project- it looks deadly awesome.
If you can support linux as well, you will have my eternal gratitude (and of many others as well).

Cannot use jQuery with ```chrome-cli execute``` command.

I got an error in the console of Google Chrome
Uncaught ReferenceError: $ is not defined
when I executed the following command
chrome-cli execute '$(".tableData a").click();' -t 532

But if I input this javascript fragment into console, everything works fine.

I tried to sleep for a while before executing to avoid not loading jQuery, but the problem remains.

Thanks for your awesome work!

Feature request: open file using CLI

as-is

$ chrome-cli open file:$(pwd)/README.adoc

to-be

~/repo $ chrome-cli open-file README.adoc # run file:$(pwd)/README.adoc
Id: 756
Title:
Url: file:///Users/user/repo/README.adoc
Loading: Yes

~/repo $ chrome-cli open-file ./README.adoc # run file:$(pwd)/README.adoc
Id: 757
Title:
Url: file:///Users/user/repo/README.adoc
Loading: Yes

~/repo $ chrome-cli open-file /Users/user/repo2/README.adoc
Id: 758
Title:
Url: file:///Users/user/repo2/README.adoc
Loading: Yes

presentation mode error

I'am experiencing some unexpected termination with presentation mode.

My environment.

$ chrome-cli version             
1.5.0
$ chrome-cli chrome version
58.0.3029.33

Errors with presentation mode.

$ chrome-cli list tabs
[6852] prasmussen/chrome-cli: Control Google Chrome from the command line

$ chrome-cli presentation -t 6852 
2017-04-05 10:17:15.131 chrome-cli[90427:7334739] -[GoogleChromeWindow enterPresentationMode]: unrecognized selector sent to instance 0x7fff0fcc2360
2017-04-05 10:17:15.145 chrome-cli[90427:7334739] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GoogleChromeWindow enterPresentationMode]: unrecognized selector sent to instance 0x7fff0fcc2360'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fffa87b0e7b __exceptionPreprocess + 171
        1   libobjc.A.dylib                     0x00007fffbd39acad objc_exception_throw + 48
        2   CoreFoundation                      0x00007fffa8832cb4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
        3   CoreFoundation                      0x00007fffa8722fb5 ___forwarding___ + 1061
        4   CoreFoundation                      0x00007fffa8722b08 _CF_forwarding_prep_0 + 120
        5   chrome-cli                          0x0000000100297845 -[App enterPresentationModeWithTab:] + 130
        6   chrome-cli                          0x0000000100299c0b -[Handler call:] + 443
        7   chrome-cli                          0x000000010029920b -[Argonaut run] + 85
        8   chrome-cli                          0x000000010029a34e main + 1548
        9   libdyld.dylib                       0x00007fffbdc7e255 start + 1
        10  ???                                 0x0000000000000004 0x0 + 4
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    90427 abort      chrome-cli presentation -t 6852

Enhance info support such as outputing title

Info outputs a list of information. Definitely we can use awk etc. to extract the Title out, but it will be more convenient to have things like chrome-cli title or chrome-cli info.title to get specific information out.

feature request: allow piping data to execute

not sure how feasible it would be (haven't looked at the source too much), but piping a javascript file to execute would be extremely useful.

$ chome-cli execute < foo.js

vs

$ chrome-cli execute `cat foo.js`

Provide Makefile

To run the program on other systems (like Linux), makefiles should be added. The program should not be built with XCode itself, as this restricts development for Mac only.

Unfortunately, I myself have no idea about objective c and also not about Make. Therefore I cannot do this myself. If this is provided I will gladly take care of the CI/CD and the like.

Not working in new Chrome version

Hi,
I have been using chrome Cleint for a long time, it is a great tool. I have noted a couple of days ago, it stopped working in new chrome version. I installed an older version of chrome and it started working. I thought of bringing this to your attention
Thanks!

`source` command no longer working

I haven't updated chrome-cli since this last worked just fine, so perhaps it's a change in Chrome itself.

I'm running Version 69.0.3497.81 (Official Build) (64-bit) on High Sierra.

Here's what I get:

$ chrome-cli list tabs
[990718318] Untitled spreadsheet - Google Sheets
[990718323] Issues · prasmussen/chrome-cli
$ chrome-cli source
$ chrome-cli source -t 990718323
$

Just nothing. The last time this worked fine for me was the beginning of August and today is the first time I've used my script that relies on this since then.

Chromium CLI

I'm trying to build chrome-cli on Mac OSX 10.8.5 as i would to make a version for Chromium as there is one for Chrome Canary but i'm getting some errors.
If i do brew unpack chrome-cli; cd chrome-cli-1.5.0; xcodebuild i get errors about no visible interface for SBElementArray that declares the selector firstObject.

Feature Request: Screenshot using CLI

I'd like to use the responsive mode from Dev Tools (a.k.a. "Device toolbar") to make a screenshot using pre-defined sized (e.g. 1280x720 px). Is this possible?

Screenshot from DevTools

No matching handler found

Well I may be just missing something obvious but I can't do anything because all I ever get is "No matching handler found".

Illegal instruction: 4

I'm on a Mac OS X 10.7.5, and Chrome: Google Chrome 34.0.1825.4 (Official Build 249291) dev

Open a page asynchronously

Will it be possible to open a page and wait for it to finish loading? It would be convenient in a script to do other things after the page is successfully loaded.

running chrome-cli from tmux session fails to connect to chrome but works otherwise

Example:

[sorokine:~] brew install tmux
[sorokine:~] tmux
[sorokine:~] $ chrome-cli list links
Waiting for chrome to start...
2019-06-17 11:11:02.805 chrome-cli[92274:18604346] Scripting Bridge could not launch application id com.google.Chrome.
2019-06-17 11:11:02.917 chrome-cli[92274:18604346] Scripting Bridge could not launch application id com.google.Chrome.
2019-06-17 11:11:03.027 chrome-cli[92274:18604346] Scripting Bridge could not launch application id com.google.Chrome.
...
Chrome did not start for 15 seconds

Which tab is active?

Thanks for chrome-cli @prasmussen -- a great tool.

Would you please add a hook to info -t [id] that indicates if that tab happens to be active in the window?

Running via cron fails to open presentation mode

When I run chrome-cli (installed via brew, os 10.9.4) in a crontab like so:

@reboot /usr/local/bin/chrome-cli presentation

I've also tried launching and then trying to start presentation mode like so:

@reboot open /Applications/Google\ Chrome.app
@reboot sleep 30 && /usr/local/bin/chrome-cli presentation

But haven't had any luck. It opens Chrome but doesn't start presentation mode. Is there any output given if the command fails? Would love to figure out why this is happening.

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.