Browser extension to hide view-reducing screen junk from websites.
Browse Source

Use visibility: hidden instead of display: none

tags/v1.1.0
Gerben 6 years ago
parent
commit
80cd386fb8
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      src/content_script.js

+ 4
- 6
src/content_script.js View File

@@ -11,14 +11,14 @@ function hideBanners() {
))

fixedElements.forEach(el => {
const originalDisplay = el.style.display
const originalVisibility = el.style.visibility
const originalOpacity = el.style.opacity
const originalTransition = el.style.transition
el.style.transition = 'opacity 1s'
el.style.opacity = '0'

const hiderTimeoutId = window.setTimeout(() => {
el.style.display = 'none'
el.style.visibility = 'hidden'
}, 1000)

revertSteps.push(() => {
@@ -26,10 +26,8 @@ function hideBanners() {
const reverterTimeoutId = window.setTimeout(() => {
el.style.transition = originalTransition
}, 1000)
el.style.display = originalDisplay
window.setTimeout(() => {
el.style.opacity = originalOpacity
})
el.style.visibility = originalVisibility
el.style.opacity = originalOpacity
})
})



Loading…
Cancel
Save