fix: avoid IPC for renderer webFrame.getZoom... APIs (#45557)

* fix: avoid IPC for renderer `webFrame.getZoom...` APIs

Co-authored-by: clavin <clavin@electronjs.org>

* Remove `DoGetZoomLevel` IPC

Co-authored-by: clavin <clavin@electronjs.org>

* Fix synchronous behavior & nullptr deref

Co-authored-by: clavin <clavin@electronjs.org>

* Use local root

Co-authored-by: clavin <clavin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
This commit is contained in:
trop[bot] 2025-02-13 12:53:59 +01:00 committed by GitHub
parent 5b90ce2290
commit aacbdaf4ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 34 deletions

View file

@ -176,15 +176,15 @@ describe('webFrame module', () => {
describe('setZoomFactor()', () => {
it('works', async () => {
const equal = await w.executeJavaScript('childFrame.setZoomFactor(2.0); childFrame.getZoomFactor() === 2.0');
expect(equal).to.be.true();
const zoom = await w.executeJavaScript('childFrame.setZoomFactor(2.0); childFrame.getZoomFactor()');
expect(zoom).to.equal(2.0);
});
});
describe('setZoomLevel()', () => {
it('works', async () => {
const equal = await w.executeJavaScript('childFrame.setZoomLevel(5); childFrame.getZoomLevel() === 5');
expect(equal).to.be.true();
const zoom = await w.executeJavaScript('childFrame.setZoomLevel(5); childFrame.getZoomLevel()');
expect(zoom).to.equal(5);
});
});