mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -05:00
Add handling for insta's tap to play interstitial
This commit is contained in:
@@ -202,10 +202,32 @@ const periscopeHacks = {
|
||||
},
|
||||
}
|
||||
|
||||
const igHacks = {
|
||||
isMatch() {
|
||||
return location.host === 'www.instagram.com'
|
||||
},
|
||||
async onLoad() {
|
||||
const playButton = await Promise.race([
|
||||
waitForQuery('button'),
|
||||
waitForQuery('video'),
|
||||
sleep(1000),
|
||||
])
|
||||
if (
|
||||
playButton.tagName === 'BUTTON' &&
|
||||
playButton.textContent === 'Tap to play'
|
||||
) {
|
||||
playButton.click()
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
async function findVideo(kind) {
|
||||
if (periscopeHacks.isMatch()) {
|
||||
await periscopeHacks.onLoad()
|
||||
}
|
||||
if (igHacks.isMatch()) {
|
||||
await igHacks.onLoad()
|
||||
}
|
||||
|
||||
const { video, iframe } = await waitForVideo(kind)
|
||||
if (!video) {
|
||||
|
||||
Reference in New Issue
Block a user