Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/Unity-Technologies/electron.git
π§ BrowserView.fromWebContents()
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
3cb062b3d6
ΠΠΎΠΌΠΌΠΈΡ
4d18cbe728
|
@ -5,4 +5,12 @@ const {BrowserView} = process.atomBinding('browser_view')
|
|||
|
||||
Object.setPrototypeOf(BrowserView.prototype, EventEmitter.prototype)
|
||||
|
||||
BrowserView.fromWebContents = (webContents) => {
|
||||
for (const view of BrowserView.getAllViews()) {
|
||||
if (view.webContents.equal(webContents)) return window
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
module.exports = BrowserView
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅