feat: Add Secure Keyboard Entry APIs in macOS (#20678)
* feat: Add Secure Keyboard Entry APIs in macOS Add methods: - app.isSecureInputEnabled() - app.setSecureInputEnabled(enabled) These enable to prevent other process listens keyboard input events. * fix: lint error in app.md for #20678 * fix: crash app.setSecureInputEnabled() in password textfield * fix: export Secure keyboard Entry API to only macOS * fix: lint error in browser_mac.mm for #20678 * test: add test for app.setSecureKeyboardEntryEnabled in macOS
This commit is contained in:
parent
5bdf97e7ae
commit
7b55a70a36
5 changed files with 64 additions and 0 deletions
|
@ -1439,6 +1439,15 @@ describe('app module', () => {
|
|||
expect(getSwitchValue).to.equal('');
|
||||
});
|
||||
});
|
||||
|
||||
ifdescribe(process.platform === 'darwin')('app.setSecureKeyboardEntryEnabled', () => {
|
||||
it('changes Secure Keyboard Entry is enabled', () => {
|
||||
app.setSecureKeyboardEntryEnabled(true);
|
||||
expect(app.isSecureKeyboardEntryEnabled()).to.equal(true);
|
||||
app.setSecureKeyboardEntryEnabled(false);
|
||||
expect(app.isSecureKeyboardEntryEnabled()).to.equal(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('default behavior', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue