prasmussen / chrome-cli

Control Google Chrome from the command line
MIT License
2.61k stars 89 forks source link

crashes in macOS 10.14 mojave #49

Closed jconley closed 5 years ago

jconley commented 5 years ago
$ 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

jmattfieldrt commented 5 years ago

I'm having the same experience on macOS 10.14.

$ chrome-cli version
1.6.0

$ chrome-cli chrome version
(null)

$ chrome-cli list windows

$ chrome-cli list tabs

$ chrome-cli open 'https://github.com'
2018-10-10 10:13:45.528 chrome-cli[80071:945460] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[SBProxyByCode tabs]: object has not been added to a container yet; selector not recognized [self = 0x7ff0e3d10df0]'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff3ea2543d __exceptionPreprocess + 256
    1   libobjc.A.dylib                     0x00007fff6a932720 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff3ea2526f +[NSException raise:format:] + 201
    3   CoreFoundation                      0x00007fff3e9c4ad0 ___forwarding___ + 1486
    4   CoreFoundation                      0x00007fff3e9c4478 _CF_forwarding_prep_0 + 120
    5   chrome-cli                          0x000000010b2791e5 -[App openUrlInNewTab:] + 189
    6   chrome-cli                          0x000000010b27bd54 -[Handler call:] + 416
    7   chrome-cli                          0x000000010b27b37a -[Argonaut run] + 85
    8   chrome-cli                          0x000000010b27c434 main + 1449
    9   libdyld.dylib                       0x00007fff6ba00085 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    80071 abort      chrome-cli open 'https://github.com'

$ chrome-cli source
2018-10-10 10:21:46.843 chrome-cli[80202:949201] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[SBProxyByCode activeTab]: object has not been added to a container yet; selector not recognized [self = 0x7fe6fac30780]'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff3ea2543d __exceptionPreprocess + 256
    1   libobjc.A.dylib                     0x00007fff6a932720 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff3ea2526f +[NSException raise:format:] + 201
    3   CoreFoundation                      0x00007fff3e9c4ad0 ___forwarding___ + 1486
    4   CoreFoundation                      0x00007fff3e9c4478 _CF_forwarding_prep_0 + 120
    5   chrome-cli                          0x0000000100f7885f -[App activeTab] + 48
    6   chrome-cli                          0x0000000100f78467 -[App printSourceFromActiveTab:] + 20
    7   chrome-cli                          0x0000000100f79d54 -[Handler call:] + 416
    8   chrome-cli                          0x0000000100f7937a -[Argonaut run] + 85
    9   chrome-cli                          0x0000000100f7a434 main + 1449
    10  libdyld.dylib                       0x00007fff6ba00085 start + 1
    11  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    80202 abort      chrome-cli source

$ chrome-cli size
2018-10-10 10:22:24.598 chrome-cli[80212:949687] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[SBProxyByCode bounds]: object has not been added to a container yet; selector not recognized [self = 0x7f9009e5f160]'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff3ea2543d __exceptionPreprocess + 256
    1   libobjc.A.dylib                     0x00007fff6a932720 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff3ea2526f +[NSException raise:format:] + 201
    3   CoreFoundation                      0x00007fff3e9c4ad0 ___forwarding___ + 1486
    4   CoreFoundation                      0x00007fff3ea49498 __forwarding_prep_1___ + 120
    5   chrome-cli                          0x0000000108289bb7 -[App printActiveWindowSize:] + 62
    6   chrome-cli                          0x000000010828bd54 -[Handler call:] + 416
    7   chrome-cli                          0x000000010828b37a -[Argonaut run] + 85
    8   chrome-cli                          0x000000010828c434 main + 1449
    9   libdyld.dylib                       0x00007fff6ba00085 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    80212 abort      chrome-cli size
albertmejia commented 5 years ago
Message:
    Error running command: `chrome-cli open http://localhost:9060`.
Details:
    killed: false
    code: null
    signal: SIGABRT
    cmd: chrome-cli open http://localhost:9060
    stdout:
    stderr: 2018-10-17 15:04:16.364 chrome-cli[2171:81969] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[SBProxyByCode tabs]: object has not been added to a container yet; selector not recognized [self = 0x7fed44823eb0]'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff5134043d __exceptionPreprocess + 256
    1   libobjc.A.dylib                     0x00007fff7d24d720 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff5134026f +[NSException raise:format:] + 201
    3   CoreFoundation                      0x00007fff512dfad0 ___forwarding___ + 1486
    4   CoreFoundation                      0x00007fff512df478 _CF_forwarding_prep_0 + 120
    5   chrome-cli                          0x0000000102ec8e8d -[App openUrlInNewTab:] + 189
    6   chrome-cli                          0x0000000102ecbc2a -[Handler call:] + 416
    7   chrome-cli                          0x0000000102ecb251 -[Argonaut run] + 85
    8   chrome-cli                          0x0000000102ecc36d main + 1548
    9   libdyld.dylib                       0x00007fff7e31b085 start + 1
    10  ???                                 0x0000000000000003 0x0 + 3
)

I'm having the same issue in macOS 10.14 as well.

jconley commented 5 years ago

this is working for me now. i think this may have been exclusive to iTerm. they added support for 10.14 in v3.2.1 and made improvements to the permissions handling in other updates. if you accidentally denied permissions to control google chrome, go to system preferences > security & privacy > privacy > Automation > iTerm and check "Google Chrome"

qkdreyer commented 4 years ago

I'm having the exact same issue while using chromium-cli inside VSCode zsh terminal, any thoughts ?

using lldb -o run -- chromium-cli instead is a valid workaround