[PR #785] Update WebPreferences's ContextIsolation default value to true #1291

Closed
opened 2026-01-29 16:59:20 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/ElectronNET/Electron.NET/pull/785

State: closed
Merged: No


I've encountered the following error: "Error: contextBridge API can only be used when contextIsolation is enabled", even though I did enable ContextIsolation.

In #411, the same issue was reported, and the problem was traced down to the fact that the default value of ContextIsolation was set to the wrong value, which made that attribute un-editable.

I then found out that the default value of ContextIsolation was changed from false to true since Electron 12, as noted here, so I fixed it.

**Original Pull Request:** https://github.com/ElectronNET/Electron.NET/pull/785 **State:** closed **Merged:** No --- I've encountered the following error: "Error: contextBridge API can only be used when contextIsolation is enabled", even though I did enable `ContextIsolation`. In #411, the same issue was reported, and the problem was traced down to the fact that the default value of `ContextIsolation` was set to the wrong value, which made that attribute un-editable. I then found out that the default value of `ContextIsolation` was changed from false to true since Electron 12, as noted [here](https://www.electronjs.org/docs/latest/tutorial/context-isolation#what-is-it), so I fixed it.
claunia added the pull-request label 2026-01-29 16:59:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1291