kiyoon / jupynium.nvim

Selenium-automated Jupyter Notebook that is synchronised with NeoVim in real-time.
MIT License
486 stars 15 forks source link

[Question] Using custom renderer #49

Closed FelixKratz closed 1 year ago

FelixKratz commented 1 year ago

From the documentation I take that Firefox is the only supported renderer because of Selenium:

Firefox (Other browsers are not supported due to their limitation with Selenium)

My question is, what Selenium features would a renderer need to support to be usable with Jupynium? Basically, I don't want to use Firefox to display the notebook and would be completely fine with creating a custom solution via WebKit (like this one: https://github.com/FelixKratz/JupyterApp-mac).

kiyoon commented 1 year ago

I tried with Chrome and Safari.

In Chrome, every time you type and the text gets updated it will focus on Chrome, which makes it unusable.

In Safari, they don't allow you to interact with the browser manually during Selenium automation. It makes it less usable.

FelixKratz commented 1 year ago

Ok thanks, I will see if I can make it work.

kiyoon commented 1 year ago

How does the web kit work? Does your web kit support Selenium?

You can modify src/jupynium/cmds/jupynium.py and there is a commented arg --browser. You can try and see if something works for you, and let me know if you found something.

FelixKratz commented 1 year ago

Basically WebKit is a way to create a "browser-like" application that has much more access to the web content than a WebDriver. So I think it would be possible to "imitate" the necessary api in an app with a WebKit view, such that it properly conforms to all the Selenium api features you are targeting.

https://developer.apple.com/documentation/webkit

kiyoon commented 1 year ago

Sounds promising. It seems like you may be able to make webkit version work, but we'll need to migrate all Selenium codes to webkit version.