feat: expose win.isContentProtected() (#47242)

* feat: expose win.isContentProtected()

* chore: remove stray _isContentProtected
This commit is contained in:
Shelley Vohr 2025-05-30 11:00:13 +02:00 committed by GitHub
commit c84e8c6c22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 7 deletions

View file

@ -331,8 +331,7 @@ describe('BrowserWindow module', () => {
afterEach(closeAllWindows);
it('can set content protection', async () => {
const w = new BrowserWindow({ show: false });
// @ts-expect-error This is a private API
expect(w._isContentProtected()).to.equal(false);
expect(w.isContentProtected()).to.equal(false);
const shown = once(w, 'show');
@ -340,8 +339,7 @@ describe('BrowserWindow module', () => {
await shown;
w.setContentProtection(true);
// @ts-expect-error This is a private API
expect(w._isContentProtected()).to.equal(true);
expect(w.isContentProtected()).to.equal(true);
});
it('does not remove content protection after the window is hidden and shown', async () => {
@ -360,8 +358,7 @@ describe('BrowserWindow module', () => {
w.show();
await shown;
// @ts-expect-error This is a private API
expect(w._isContentProtected()).to.equal(true);
expect(w.isContentProtected()).to.equal(true);
});
});