mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-24 22:22:50 -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) {
|
async function findVideo(kind) {
|
||||||
if (periscopeHacks.isMatch()) {
|
if (periscopeHacks.isMatch()) {
|
||||||
await periscopeHacks.onLoad()
|
await periscopeHacks.onLoad()
|
||||||
}
|
}
|
||||||
|
if (igHacks.isMatch()) {
|
||||||
|
await igHacks.onLoad()
|
||||||
|
}
|
||||||
|
|
||||||
const { video, iframe } = await waitForVideo(kind)
|
const { video, iframe } = await waitForVideo(kind)
|
||||||
if (!video) {
|
if (!video) {
|
||||||
|
|||||||
Reference in New Issue
Block a user