mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-27 07:36:15 -04:00
UI: Fix case where cef func may not be present
Due to a particular... plugin we all know and love, the new QCefWidget::executeJavascript() function may not actually be present as it should be. So, we have to verify that it's available, and only use it in that case.
This commit is contained in:
@@ -116,6 +116,7 @@ struct QCefCookieManager;
|
||||
|
||||
QCef *cef = nullptr;
|
||||
QCefCookieManager *panel_cookies = nullptr;
|
||||
bool cef_js_avail = false;
|
||||
|
||||
void DestroyPanelCookieManager();
|
||||
|
||||
@@ -2022,6 +2023,7 @@ void OBSBasic::OBSInit()
|
||||
|
||||
#ifdef BROWSER_AVAILABLE
|
||||
cef = obs_browser_init_panel();
|
||||
cef_js_avail = cef && obs_browser_qcef_version() >= 3;
|
||||
#endif
|
||||
|
||||
OBSDataAutoRelease obsData = obs_get_private_data();
|
||||
@@ -8493,7 +8495,7 @@ YouTubeAppDock *OBSBasic::GetYouTubeAppDock()
|
||||
|
||||
void OBSBasic::NewYouTubeAppDock()
|
||||
{
|
||||
if (!cef)
|
||||
if (!cef_js_avail)
|
||||
return;
|
||||
|
||||
if (youtubeAppDock)
|
||||
@@ -8504,7 +8506,7 @@ void OBSBasic::NewYouTubeAppDock()
|
||||
|
||||
void OBSBasic::DeleteYouTubeAppDock()
|
||||
{
|
||||
if (!cef)
|
||||
if (!cef_js_avail)
|
||||
return;
|
||||
|
||||
if (youtubeAppDock)
|
||||
|
||||
Reference in New Issue
Block a user