feat(script): remove html element margin-top
This commit is contained in:
parent
f20c420137
commit
8eeda96026
@ -3,4 +3,4 @@ export const UNTOUCHABLE_SITES = [
|
|||||||
'www.gamemania.be',
|
'www.gamemania.be',
|
||||||
'www.guysandstthomas.nhs.uk',
|
'www.guysandstthomas.nhs.uk',
|
||||||
'www.youtube.com',
|
'www.youtube.com',
|
||||||
];
|
];
|
||||||
|
@ -30,6 +30,7 @@ const doMagic = () => {
|
|||||||
|
|
||||||
// Fixing main elements
|
// Fixing main elements
|
||||||
if (!UNTOUCHABLE_SITES.includes(document.location.host)) {
|
if (!UNTOUCHABLE_SITES.includes(document.location.host)) {
|
||||||
|
document.documentElement.style.setProperty('margin-top', 'unset', 'important');
|
||||||
document.documentElement.style.setProperty('overflow', 'unset', 'important');
|
document.documentElement.style.setProperty('overflow', 'unset', 'important');
|
||||||
document.documentElement.style.setProperty('position', 'unset', 'important');
|
document.documentElement.style.setProperty('position', 'unset', 'important');
|
||||||
document.body.style.setProperty('overflow', 'unset', 'important');
|
document.body.style.setProperty('overflow', 'unset', 'important');
|
||||||
@ -37,7 +38,11 @@ const doMagic = () => {
|
|||||||
|
|
||||||
// Remove irritating all removable elements
|
// Remove irritating all removable elements
|
||||||
removable.forEach(element => {
|
removable.forEach(element => {
|
||||||
if (element.tagName !== 'body' && element.tagName !== 'html') {
|
const isRemovable =
|
||||||
|
element.tagName.toLowerCase() !== 'body'
|
||||||
|
&& element.tagName.toLowerCase() !== 'html';
|
||||||
|
|
||||||
|
if (isRemovable) {
|
||||||
const exists =
|
const exists =
|
||||||
document.getElementById(element.id)
|
document.getElementById(element.id)
|
||||||
|| document.getElementsByName(element.name).length > 0
|
|| document.getElementsByName(element.name).length > 0
|
||||||
@ -70,4 +75,4 @@ const observe = () => {
|
|||||||
// Then...
|
// Then...
|
||||||
disableCookies();
|
disableCookies();
|
||||||
doMagic();
|
doMagic();
|
||||||
observe();
|
observe();
|
||||||
|
Loading…
Reference in New Issue
Block a user