Skip to content

Commit

Permalink
fix: clear preview image on gdrive
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Jul 1, 2020
1 parent 6bbbe12 commit b95e532
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/metastream-remote-extension/src/scripts/googledrive.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
window.addEventListener('load', () => {
const previewImg = document.querySelector('img:not([alt=""])')
if (previewImg) {
previewImg.click()
function clearPreview() {
const previewImg = document.querySelector('img:not([alt=""])')
if (previewImg) {
previewImg.click()
return true
}
}
})

const start = Date.now()
const intervalId = setInterval(() => {
if (clearPreview() || Date.now() - start > 10e3) {
clearInterval(intervalId)
}
}, 500)
}, false)

0 comments on commit b95e532

Please sign in to comment.