How to create JBCefBrowser with CefRequestContextHandler?
Hello!
Faced the following problem:
I need to put some javascript in the page every time the content is loaded in the JBCefBrowser and org.cef.handler.CefRequestHandler#getResourceRequestHandler - helped me a lot with this.
Unfortunately, org.cef.handler.CefRequestHandler is useless in situations where Service Workers are used and we have to use org.cef.handler.CefRequestContextHandler as said in https://magpcss.org/ceforum/viewtopic.php?f=6&t=18520&p=49496&hilit=service+worker#p49496 .
So, the problem is - I am unable to find a way to create JBCefBrowser with custom CefRequestContextHandler...
As following from your API the most convenient way to create a JBCefBrowser is something like that:
com.intellij.ui.jcef.JBCefBrowser#create
But there are no parameters/methods to set/add custom CefRequestContextHandler.
Could you please advise how to proceed in this case?
Best regards, Andrew.
请先登录再写评论。
Forwarded, please allow some time for answer. Thanks.
Hello! Unfortunately current api doesn't allow to create JBCefBrowser with custom CefRequestContextHandler. This possibility will be implemented in 23.1 (https://youtrack.jetbrains.com/issue/IDEA-305820).
The workaround is to create browser like this:
Thank you very much I will be waiting for 23.1 )