timelyart / Kairos

Kairos aims to help you save time by automating repetitive tasks on TradingView such as scanning markets for setups, and refreshing alerts as well as creating new ones.
GNU General Public License v3.0
70 stars 31 forks source link

javascript error: LavaMoat - property "open" of globalThis is inaccessible under scuttling mode #122

Closed jerajx closed 1 week ago

jerajx commented 1 week ago

Describe the bug I'm trying to export or just browse the watchlist. I'm getting this error since chrome upgrade from v. 128 to 129, I tried to downgrade chrome, but still didn't work. Tried on two different computers, win 10 and win 11, also used -cls tag - didn't solve the problem.

Desktop (please complete the following information):

Additional context error log:

python main.py export_mj.yaml

======================================== 2024-10-09 18:44:46 - Start Program

DISCLAIMER This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

USAGE python main.py [] [-s|-s ] [-h] [-d] For help, type: python main.py -h

2024-10-09 18:44:46.969 INFO tv - run: Running on a windows operating system 2024-10-09 18:44:48.281 INFO tv - assign_user_data_directory: kairos_0 assigned 2024-10-09 18:44:48.474 INFO utils - download_chromedriver: Chromedriver is already installed. 2024-10-09 18:44:48.474 INFO tv - create_browser: using c:\TEMP\129\chromedriver.exe as webdriver

DevTools listening on ws://127.0.0.1:53130/devtools/browser/e2014434-4817-423f-b70f-dc00535b8827 2024-10-09 18:44:49.663 INFO tv - check_driver: browser version: 129.0.6668.101 2024-10-09 18:44:49.663 INFO tv - check_driver: driver version: 129.0.6668.91 2024-10-09 18:44:54.581 INFO tv - login: already logged in (Premium account) 2024-10-09 18:44:54.907 INFO tv - open_chart: opening chart https://www.tradingview.com/chart/SAlo97VC 2024-10-09 18:44:54.908 INFO tv - open_chart: WAIT_TIME_IMPLICIT = 3.0 2024-10-09 18:44:54.908 INFO tv - open_chart: PAGE_LOAD_TIMEOUT = 60.0 2024-10-09 18:44:54.909 INFO tv - open_chart: CHECK_IF_EXISTS_TIMEOUT = 30.0 2024-10-09 18:44:54.909 INFO tv - open_chart: DELAY_BREAK_MINI = 0.1 2024-10-09 18:44:54.909 INFO tv - open_chart: DELAY_BREAK = 0.25 2024-10-09 18:44:54.910 INFO tv - open_chart: DELAY_SUBMIT_ALERT = 0.0 2024-10-09 18:44:54.910 INFO tv - open_chart: DELAY_CHANGE_SYMBOL = 20.0 2024-10-09 18:44:54.910 INFO tv - open_chart: DELAY_CLEAR_INACTIVE_ALERTS = 2.0 2024-10-09 18:44:54.911 INFO tv - open_chart: DELAY_KEYSTROKE = 0.05 2024-10-09 18:44:54.911 INFO tv - open_chart: DELAY_READ_INDICATOR_VALUE = 0.2 2024-10-09 18:44:54.911 INFO tv - open_chart: READ_FROM_DATA_WINDOW = True 2024-10-09 18:44:54.912 INFO tv - open_chart: WAIT_UNTIL_CHART_IS_LOADED = True 2024-10-09 18:44:54.912 INFO tv - open_chart: READ_ALL_VALUES_AT_ONCE = True 2024-10-09 18:44:54.912 INFO tv - open_chart: CHANGE_SYMBOL_WITH_SPACE = False 2024-10-09 18:44:54.913 INFO tv - open_chart: VERIFY_MARKET_LISTING = True 2024-10-09 18:44:54.913 INFO tv - open_chart: ACCEPT_PERFORMANCE_ANALYTICS_COOKIES = False 2024-10-09 18:44:54.914 INFO tv - open_chart: ACCEPT_ADVERTISING_COOKIES = False

2024-10-09 18:44:54.918 ERROR tv - open_chart: Message: javascript error: LavaMoat - property "open" of globalThis is inaccessible under scuttling mode. To learn more visit https://github.com/LavaMoat/LavaMoat/pull/360. (Session info: chrome=129.0.6668.101) Stacktrace: GetHandleVerifier [0x004270E3+25587] (No symbol) [0x003BA284] (No symbol) [0x002B2113] (No symbol) [0x002B7CC4] (No symbol) [0x002B981F] (No symbol) [0x00336177] (No symbol) [0x0031AB9C] (No symbol) [0x00335370] (No symbol) [0x0031A936] (No symbol) [0x002EBA73] (No symbol) [0x002EC4CD] GetHandleVerifier [0x00704C23+3030835] GetHandleVerifier [0x00756B59+3366505] GetHandleVerifier [0x004B9592+624802] GetHandleVerifier [0x004C0E0C+655644] (No symbol) [0x003C2C3D] (No symbol) [0x003BFD08] (No symbol) [0x003BFEA5] (No symbol) [0x003B22D6] BaseThreadInitThunk [0x763E7BA9+25] RtlInitializeExceptionChain [0x77B5C0CB+107] RtlClearBits [0x77B5C04F+191]

Traceback (most recent call last): File "C:\TEMP\Kairos-master23-09-2024\tv\tv.py", line 1179, in open_chart browser.execute_script("window.open('" + url + "');") File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 404, in execute_script return self.execute(command, {"script": script, "args": converted_args})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 344, in execute self.error_handler.check_response(response) File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: LavaMoat - property "open" of globalThis is inaccessible under scuttling mode. To learn more visit https://github.com/LavaMoat/LavaMoat/pull/360. (Session info: chrome=129.0.6668.101) Stacktrace: GetHandleVerifier [0x004270E3+25587] (No symbol) [0x003BA284] (No symbol) [0x002B2113] (No symbol) [0x002B7CC4] (No symbol) [0x002B981F] (No symbol) [0x00336177] (No symbol) [0x0031AB9C] (No symbol) [0x00335370] (No symbol) [0x0031A936] (No symbol) [0x002EBA73] (No symbol) [0x002EC4CD] GetHandleVerifier [0x00704C23+3030835] GetHandleVerifier [0x00756B59+3366505] GetHandleVerifier [0x004B9592+624802] GetHandleVerifier [0x004C0E0C+655644] (No symbol) [0x003C2C3D] (No symbol) [0x003BFD08] (No symbol) [0x003BFEA5] (No symbol) [0x003B22D6] BaseThreadInitThunk [0x763E7BA9+25] RtlInitializeExceptionChain [0x77B5C0CB+107] RtlClearBits [0x77B5C04F+191]

2024-10-09 18:45:54.995 ERROR tv - snapshot: Message: timeout: Timed out receiving message from renderer: 10.000 (Session info: chrome=129.0.6668.101) Stacktrace: GetHandleVerifier [0x004270E3+25587] (No symbol) [0x003BA284] (No symbol) [0x002B2113] (No symbol) [0x0029E305] (No symbol) [0x0029E038] (No symbol) [0x0029C488] (No symbol) [0x0029CB3D] (No symbol) [0x002BD732] (No symbol) [0x00340A6F] (No symbol) [0x0031AB9C] (No symbol) [0x00335370] (No symbol) [0x0031A936] (No symbol) [0x002EBA73] (No symbol) [0x002EC4CD] GetHandleVerifier [0x00704C23+3030835] GetHandleVerifier [0x00756B59+3366505] GetHandleVerifier [0x004B9592+624802] GetHandleVerifier [0x004C0E0C+655644] (No symbol) [0x003C2C3D] (No symbol) [0x003BFD08] (No symbol) [0x003BFEA5] (No symbol) [0x003B22D6] BaseThreadInitThunk [0x763E7BA9+25] RtlInitializeExceptionChain [0x77B5C0CB+107] RtlClearBits [0x77B5C04F+191]

Traceback (most recent call last): File "C:\TEMP\Kairos-master23-09-2024\tv\tv.py", line 1179, in open_chart browser.execute_script("window.open('" + url + "');") File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 404, in execute_script return self.execute(command, {"script": script, "args": converted_args})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 344, in execute self.error_handler.check_response(response) File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: LavaMoat - property "open" of globalThis is inaccessible under scuttling mode. To learn more visit https://github.com/LavaMoat/LavaMoat/pull/360. (Session info: chrome=129.0.6668.101) Stacktrace: GetHandleVerifier [0x004270E3+25587] (No symbol) [0x003BA284] (No symbol) [0x002B2113] (No symbol) [0x002B7CC4] (No symbol) [0x002B981F] (No symbol) [0x00336177] (No symbol) [0x0031AB9C] (No symbol) [0x00335370] (No symbol) [0x0031A936] (No symbol) [0x002EBA73] (No symbol) [0x002EC4CD] GetHandleVerifier [0x00704C23+3030835] GetHandleVerifier [0x00756B59+3366505] GetHandleVerifier [0x004B9592+624802] GetHandleVerifier [0x004C0E0C+655644] (No symbol) [0x003C2C3D] (No symbol) [0x003BFD08] (No symbol) [0x003BFEA5] (No symbol) [0x003B22D6] BaseThreadInitThunk [0x763E7BA9+25] RtlInitializeExceptionChain [0x77B5C0CB+107] RtlClearBits [0x77B5C04F+191]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\TEMP\Kairos-master23-09-2024\tv\tv.py", line 2182, in snapshot browser.save_screenshot(filename) File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 825, in save_screenshot return self.get_screenshot_as_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 801, in get_screenshot_as_file png = self.get_screenshot_as_png() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 835, in get_screenshot_as_png return b64decode(self.get_screenshot_as_base64().encode("ascii")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 846, in get_screenshot_as_base64 return self.execute(Command.SCREENSHOT)["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\webdriver.py", line 344, in execute self.error_handler.check_response(response) File "C:\Users\Uporabnik\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium-4.12.0-py3.11.egg\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 10.000 (Session info: chrome=129.0.6668.101) Stacktrace: GetHandleVerifier [0x004270E3+25587] (No symbol) [0x003BA284] (No symbol) [0x002B2113] (No symbol) [0x0029E305] (No symbol) [0x0029E038] (No symbol) [0x0029C488] (No symbol) [0x0029CB3D] (No symbol) [0x002BD732] (No symbol) [0x00340A6F] (No symbol) [0x0031AB9C] (No symbol) [0x00335370] (No symbol) [0x0031A936] (No symbol) [0x002EBA73] (No symbol) [0x002EC4CD] GetHandleVerifier [0x00704C23+3030835] GetHandleVerifier [0x00756B59+3366505] GetHandleVerifier [0x004B9592+624802] GetHandleVerifier [0x004C0E0C+655644] (No symbol) [0x003C2C3D] (No symbol) [0x003BFD08] (No symbol) [0x003BFEA5] (No symbol) [0x003B22D6] BaseThreadInitThunk [0x763E7BA9+25] RtlInitializeExceptionChain [0x77B5C0CB+107] RtlClearBits [0x77B5C04F+191]

2024-10-09 18:45:54.997 INFO tv - run: No alerts or signals set

2024-10-09 18:45:54.998 INFO tv - run: No signals triggered. Nothing to send

======================================== 2024-10-09 18:46:01 - End Program Elapsed time: 1 minute, 14 seconds

timelyart commented 1 week ago

Looking at the error the following line piqued my interest:

2024-10-09 18:44:54.918 ERROR tv - open_chart: Message: javascript error: LavaMoat - property "open" of globalThis is inaccessible under scuttling mode. To learn more visit https://github.com/LavaMoat/LavaMoat/pull/360.

I have never heard of LavaMoat. At first I thought it may be a dependency for Selenium but doing further research it seems to be made by Metamask and funded by ConsenSys. It might be that the Metamask extension is using this library and that it is interfering with Selenium. Do you have Metamask installed?

jerajx commented 1 week ago

Yes, I had the Metamask. I removed it but still had to manually remove the script itself. And now it is working fine. Thanks!

Best Regards, Marko

V V sre., 9. okt. 2024 ob 21:02 je oseba timelyart @.***> napisala:

Looking at the error the following line piqued my interest:

2024-10-09 18:44:54.918 ERROR tv - open_chart: Message: javascript error: LavaMoat - property "open" of globalThis is inaccessible under scuttling mode. To learn more visit https://github.com/LavaMoat/LavaMoat/pull/360.

I have never heard of LavaMoat. At first I thought it may be a dependency for Selenium but doing further research it seems to be made by Metamask and funded by ConsenSys. It might be that the Metamask extension is using this library and that it is interfering with Selenium. Do you have Metamask installed?

— Reply to this email directly, view it on GitHub https://github.com/timelyart/Kairos/issues/122#issuecomment-2403162096, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7TPMPBSMH3GJMAVPY26OLZ2V4SRAVCNFSM6AAAAABPU67S5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBTGE3DEMBZGY . You are receiving this because you authored the thread.Message ID: @.***>

timelyart commented 1 week ago

Glad to hear that you got it fixed.

Using a shared data directory, i.e. share_user_data = true in your kairos.cfg should enable you to use Kairos without the extension whilst having it in your day-to-day Chrome. To do so, follow these steps:

  1. Run Kairos with -cls - this will remove any old copies of your Chrome user dir
  2. Run Kairos again - a fresh copy of your Chrome user dir is made without Metamask
  3. Add Metamask as an extension to Chrome as you would normally do
jerajx commented 1 week ago

Thanks for the advice!

V V čet., 10. okt. 2024 ob 10:00 je oseba timelyart < @.***> napisala:

Glad to hear that you got it fixed.

Using a shared data directory, i.e. share_user_data = true in your kairos.cfg should enable you to use Kairos without the extension whilst having it in your day-to-day Chrome. To do so, follow these steps:

  1. Run Kairos with -cls - this will remove any old copies of your Chrome user dir
  2. Run Kairos again - a fresh copy of your Chrome user dir is made without Metamask
  3. Add Metamask as an extension to Chrome as you would normally do

— Reply to this email directly, view it on GitHub https://github.com/timelyart/Kairos/issues/122#issuecomment-2404363923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7TPMKNSAE5PY7USTV7UELZ2YXZBAVCNFSM6AAAAABPU67S5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBUGM3DGOJSGM . You are receiving this because you authored the thread.Message ID: @.***>