From fd25d28997a2fa2ae7d4e11443581268c09bc619 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sat, 16 Dec 2017 17:39:40 +0800 Subject: [PATCH] Improve/fix querySelector usage --- content.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/content.js b/content.js index a3fcbff..b3d46a5 100644 --- a/content.js +++ b/content.js @@ -5,23 +5,23 @@ var makeReadable = function() { // Un-position:fixed the top nav bar var topNav = document.querySelector('.metabar.u-fixed'); - if (topNav != null) { + if (topNav) { topNav.classList.remove('u-fixed'); } // Remove the footer var getUpdatesBar = document.querySelector('.js-stickyFooter'); - if (getUpdatesBar != null) { + if (getUpdatesBar) { getUpdatesBar.style.display = 'none'; } }; var hideDickbar = function() { var dickbar = document.querySelector('.js-postShareWidget'); - if (dickbar != null) { + if (dickbar) { dickbar.style.display = 'none'; } var footerDickbar = document.querySelector('footer > .container:first-child'); - if (footerDickbar != null) { + if (footerDickbar) { footerDickbar.style.display = 'none'; } }; @@ -29,14 +29,14 @@ var hideDickbar = function() { var disableLazyLoading = function() { // Get all