BFergerson / Journey

JCEF-powered cross-platform web browser
Apache License 2.0
99 stars 26 forks source link

IntelliJ plugin support (Linux) #3

Open BFergerson opened 5 years ago

BFergerson commented 5 years ago

Opened discussion: https://magpcss.org/ceforum/viewtopic.php?f=17&t=16791&sid=555687dcd0366db372166c0e2594e566

May need to create an issue now.

ilyamochalov commented 5 years ago

I have issues running CEF browser inside IntelliJ plugin also. I am on Ubuntu 16, using cef_binary_73.1.11+ge6986dc+chromium-73.0.3683.75_linux64.tar.bz2. My error stack trace is following (happens when calling CefApp.getInstance()):

java.lang.UnsatisfiedLinkError: org.cef.CefApp.N_PreInitialize()Z
    at org.cef.CefApp.N_PreInitialize(Native Method)
    at org.cef.CefApp.access$000(CefApp.java:24)
    at org.cef.CefApp$1.run(CefApp.java:162)
    at org.cef.CefApp.<init>(CefApp.java:167)
    at org.cef.CefApp.getInstance(CefApp.java:220)
    at org.cef.CefApp.getInstance(CefApp.java:207)
...
BFergerson commented 5 years ago

@ilyamochalov, unfortunately I do not remember how I solved that issue and I can't seem to reproduce it either. I know I've run into it though and I'm thinking it might have to do with mismatched versions of JCEF and CEF (like mentioned here).

I do believe that once you get past this issue you will run into the same issues I'm facing though as your error is arising during CefApp.getInstance. You should be able to get past that issue by using Journey, but again you are likely to run into IntelliJ crashing as it does for me.

fkolar commented 5 years ago

I am using this inside intellij plugins all works under Mac and soon I will be testing this on other platforms.

here is the project you might check out: https://github.com/fkolar/angular-console/tree/master/apps/intellij

It starts in the background nodeJS server, setups RPC comunication and once server is started I setup ToolWindow and place that WebView into it.

fkolar commented 5 years ago

Do you still have a problem with this? I just tested my plugin with your package inside window and even it works, I am running to issue where the JourneyBrowserView does not streatch all the way inside its parent container (JPanel). On Mac I have no problem with this.

Even I tried to set directly size as you can see but it has no effect.

IMG_0244 IMG_0243

BFergerson commented 5 years ago

@fkolar, this issue is only for Linux. Journey should work correctly on Windows and macOS inside of IntelliJ plugins. As for your Windows issue, it appears to be the same as: https://github.com/CodeBrig/Journey/issues/13

Are you using the latest version of Journey (0.2.18)?

P.s. Your keyboard should have a button for taking screenshots. They come out much nicer ;).

fkolar commented 5 years ago

I know. I am using sons PC with 4MB ram where I have nothing setup, so I would not be able to get thouse picture out - easily ;-)

I am not sure if its the same as #13 , the window is 100% of its size. In your case it scrolls mine fits, but the outter frame simply does not expand all the way. But it might be the content of html has overflow set to hidden

As you can see, I am adding the browser to the CENTER of the RED panel and this panel takes up whole width.

I am using 0.2.18-offline.

Let me try to extract this into separate project with simple intellij plugin.

fkolar commented 5 years ago

I have created simple plugin where I demostrate what is the issue. I wonder if you have the same problem on your side:

https://github.com/fkolar/journey-intellij-plugin

BFergerson commented 5 years ago

@fkolar, I was able to replicate your issue but I was not able to find a solution. I made a smaller reproducible example: https://github.com/BFergerson/journey-intellij-windows-issue. I'm honestly not sure what's going wrong.

I would like to thank you for that demonstration plugin code though because it actually works on Linux and getting Journey working in a Linux plugin was the purpose of this issue. Turns out it's the 2019 version of IntelliJ where Journey stops working correctly. Versions IU-2016.1 through IU-2018.3.5 have no issue running Journey. Because of your demonstration code I was able to increase compatibility on my main project (https://github.com/sourceplusplus/Assistant/issues/68), which is the reason I created Journey to begin with.

Given that your issue isn't with Linux I made another issue for tracking: https://github.com/CodeBrig/Journey/issues/21

BFergerson commented 4 years ago

An embedded version of JCEF is now available for IntelliJ 2020.1+ (https://www.jetbrains.org/intellij/sdk/docs/reference_guide/jcef.html).