Files
cefsharp/CefSharp.BrowserSubprocess.Core/JavascriptBindingSettings.h
T
campersau 00c8aa5449 Allow JavaScript binding when browser wrapper cannot be found (#5229)
* Allow JavaScript binding when browser wrapper cannot be found

* Store JavascriptBindingSettings per Browser and never remove them

This avoids the issue that sometimes browsers are destroyed but then referenced again without them beeing created

* Use dict->Values
2026-04-10 18:00:04 +10:00

48 lines
1.4 KiB
C++

// Copyright © 2013 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "include/cef_v8.h"
#include "Stdafx.h"
namespace CefSharp
{
namespace BrowserSubprocess
{
private ref class JavascriptBindingSettings
{
private:
MCefRefPtr<CefListValue> _javascriptBindingApiAllowOrigins;
public:
JavascriptBindingSettings()
{
JavascriptBindingApiEnabled = true;
JavascriptBindingApiHasAllowOrigins = false;
JavascriptBindingApiAllowOrigins = nullptr;
}
!JavascriptBindingSettings()
{
_javascriptBindingApiAllowOrigins = nullptr;
}
~JavascriptBindingSettings()
{
this->!JavascriptBindingSettings();
}
property bool JavascriptBindingApiEnabled;
property bool JavascriptBindingApiHasAllowOrigins;
property CefRefPtr<CefListValue> JavascriptBindingApiAllowOrigins
{
CefRefPtr<CefListValue> get() { return _javascriptBindingApiAllowOrigins.get(); }
void set(CefRefPtr<CefListValue> value) { _javascriptBindingApiAllowOrigins = value.get(); }
}
};
}
}