mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
fix: enable BrowserWindow.id access post-destruction (#38241)
fix: enable BrowserWindow id access post-destruction
This commit is contained in:
@@ -12,6 +12,14 @@ BrowserWindow.prototype._init = function (this: BWT) {
|
||||
// Avoid recursive require.
|
||||
const { app } = require('electron');
|
||||
|
||||
// Set ID at constructon time so it's accessible after
|
||||
// underlying window destruction.
|
||||
const id = this.id;
|
||||
Object.defineProperty(this, 'id', {
|
||||
value: id,
|
||||
writable: false
|
||||
});
|
||||
|
||||
const nativeSetBounds = this.setBounds;
|
||||
this.setBounds = (bounds, ...opts) => {
|
||||
bounds = {
|
||||
|
||||
Reference in New Issue
Block a user