You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to link ui files together? Paths resolve to eg. c:/path/foo, instead of c:/../project-root/ui-root/path/foo. If linked manually it works, but obv that's not the way. This happens with any resource e.g.
because blui:// protocol starts at root c by default, because it actually just replaces string to file:// protocol, and root for file is c, while for http:// it would be ok. I'm using node to pre generate static htmls (it shouldn't matter, but specifically vue, vue-router, webpack, react-snap). When developing (npm run dev and open localhost:8080) everything is ok, because it serves http:// protocol .
I see UBluEye::LoadURL does path string replace to add project dir FPaths::ProjectDir() but if I'm not mistaken, that handles only initial access and not the problem I'm having, the html resource access. Best option is handling this with cef, implementing an actual custom blui:// protocol (wiki link). (I'm basing my "best" based on 1. CppCon 2019 HTML 5 for GUI in C++, 2. Blog post on c# cef without http, 3. StackOverflow - webpack in cef). Is this done somewhere? I couldn't find it.
I've added public CefBrowserProcessHandler to BluManager and
voidBluManager::OnRegisterCustomSchemes (CefRawPtr<CefSchemeRegistrar> registrar) {
UE_LOG(LogBlu, Log, TEXT("PROCESS: OnRegisterCustomSchemes (ui://)")); // called on editor start
registrar->AddCustomScheme("ui", CEF_SCHEME_OPTION_CSP_BYPASSING); // <----- option ok? means:// If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content-// Security-Policy (CSP) checks. This value should not be set in most cases// where CEF_SCHEME_OPTION_STANDARD is set.
}
voidBluManager::OnContextInitialized () {
UE_LOG(LogBlu, Log, TEXT("PROCESS: OnContextInitialized <----- I never get called"));
// CefRegisterSchemeHandlerFactory("ui", CefString(), new MakeSchemeUI());
}
Also I've added SchemeUI.h but don't know how to continue.
// this is just declarations <---------
#pragma once
#include"CEFInclude.h"
#include"BluLog.h"// moved logsclassUseSchemeUI : publicCefResourceHandler {
virtualboolOpen (
CefRefPtr<CefRequest> request,
bool& handle_request,
CefRefPtr<CefCallback> callback
) override {
handle_request = true;
UE_LOG(LogBlu, Log, TEXT("UseSchemeUI <----- I never get called"));
returntrue;
}
virtualvoidCancel() override {}
virtualvoidGetResponseHeaders (
CefRefPtr<CefResponse> response,
int64& response_length,
CefString& redirectUrl
) override {}
IMPLEMENT_REFCOUNTING(UseSchemeUI);
};
classMakeSchemeUI : publicCefSchemeHandlerFactory { public:virtual CefRefPtr<CefResourceHandler> Create (
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& scheme_name,
CefRefPtr<CefRequest> request
) override { returnnewUseSchemeUI(); }
IMPLEMENT_REFCOUNTING(MakeSchemeUI);
};
The text was updated successfully, but these errors were encountered:
How to link ui files together? Paths resolve to eg.
c:/path/foo
, instead ofc:/../project-root/ui-root/path/foo
. If linked manually it works, but obv that's not the way. This happens with any resource e.g.because
blui://
protocol starts at root c by default, because it actually just replaces string tofile://
protocol, and root for file is c, while forhttp://
it would be ok. I'm using node to pre generate static htmls (it shouldn't matter, but specifically vue, vue-router, webpack, react-snap). When developing (npm run dev
and openlocalhost:8080
) everything is ok, because it serveshttp://
protocol .I see
UBluEye::LoadURL
does path string replace to add project dirFPaths::ProjectDir()
but if I'm not mistaken, that handles only initial access and not the problem I'm having, the html resource access. Best option is handling this with cef, implementing an actual customblui://
protocol (wiki link). (I'm basing my "best" based on 1. CppCon 2019 HTML 5 for GUI in C++, 2. Blog post on c# cef without http, 3. StackOverflow - webpack in cef). Is this done somewhere? I couldn't find it.I've added
public CefBrowserProcessHandler
toBluManager
andAlso I've added
SchemeUI.h
but don't know how to continue.The text was updated successfully, but these errors were encountered: