mirror of
https://github.com/streamwall/streamwall.git
synced 2026-04-03 20:32:08 -04:00
Wrap injected JS in IIFE to prevent scope conflicts
This commit is contained in:
@@ -221,6 +221,7 @@ const viewStateMachine = Machine(
|
|||||||
}
|
}
|
||||||
const wc = view.webContents
|
const wc = view.webContents
|
||||||
const info = await wc.executeJavaScript(`
|
const info = await wc.executeJavaScript(`
|
||||||
|
(function() {
|
||||||
const sleep = ms => new Promise((resolve) => setTimeout(resolve, ms))
|
const sleep = ms => new Promise((resolve) => setTimeout(resolve, ms))
|
||||||
|
|
||||||
async function waitForVideo() {
|
async function waitForVideo() {
|
||||||
@@ -336,6 +337,7 @@ const viewStateMachine = Machine(
|
|||||||
return info
|
return info
|
||||||
}
|
}
|
||||||
findVideo()
|
findVideo()
|
||||||
|
}())
|
||||||
`)
|
`)
|
||||||
return info
|
return info
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user