Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

error: contextbridge api can only be used when contextisolation is enabled

<!doctype html>
<html lang="en-US">
<head>
    <meta charset="utf-8"/>
    <title>Title</title>
</head>
<body>
    <script>
        window.api.receive("fromMain", (data) => {
            console.log(`Received ${data} from main process`);
        });
        window.api.send("toMain", "some data");
    </script>
</body>
</html>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #contextbridge #api #contextisolation #enabled
ADD COMMENT
Topic
Name
7+4 =