kyy
2025-07-02 07558e32634314eec359ec8437d97bdc5def64f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright © 2020 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 "Stdafx.h"
#include "include\cef_v8.h"
 
namespace CefSharp
{
    namespace BrowserSubprocess
    {
        /// <summary>
        /// Global CEF methods are exposed through this class. e.g. CefRegisterExtension maps to Cef.RegisterExtension
        /// Only methods relevant to the Render Process are included in this class.
        /// CEF API Doc https://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html
        /// This class cannot be inherited.
        /// </summary>
        public ref class Cef sealed
        {
        public:
            /// <summary>
            /// Register a new V8 extension with the specified JavaScript extension code.
            /// </summary>
            /// <param name="name">name</param>
            /// <param name="javascriptCode">JavaScript code</param>
            static void RegisterExtension(String^ name, String^ javascriptCode)
            {
                CefRegisterExtension(StringUtils::ToNative(name), StringUtils::ToNative(javascriptCode), nullptr);
            }
        };
    }
}