From 1d0c5744ac9c3d8cdb36c17a29e51efb717d7979 Mon Sep 17 00:00:00 2001 From: Spongman Date: Sun, 21 Mar 2021 11:39:28 -0700 Subject: [PATCH] Update content_script.js avoid exception during google oauth --- src/js/content_script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/content_script.js b/src/js/content_script.js index 178832a..bca8f2e 100644 --- a/src/js/content_script.js +++ b/src/js/content_script.js @@ -175,7 +175,9 @@ blocklist.searchpage.initMutationObserver = function () { const SEARCH_RESULTS_WRAP = "div#center_col"; let target = document.querySelector(SEARCH_RESULTS_WRAP); let config = { childList: true, subtree: true }; - blocklist.searchpage.mutationObserver.observe(target, config); + if (target != null) { // null or undefined + blocklist.searchpage.mutationObserver.observe(target, config); + } } blocklist.searchpage.modifySearchResultsAdded = function (mutations) {