Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions scripts/remover.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
return chrome.runtime.sendMessage({ event: this.constants.events.inactive, url: window.location.href });
}
chrome.runtime.sendMessage({ event: this.constants.events.get_info }, (info) => {
var tId = info.tId;
var wId = info.wId;
const { tId, wId } = info;
this.currentUrl[wId] = this.currentUrl[wId] ? this.currentUrl[wId] : {};
this.currentUrl[wId][tId] = window.location.href;
this.remove(info);
Expand All @@ -37,8 +36,7 @@
return document.querySelectorAll(this.constants.queries.result_links);
},
remove: function(info) {
var tId = info.tId;
var wId = info.wId;
const { tId, wId } = info;
var links = this.getAllW3Links();
var count = links.length;
if(!count) {
Expand All @@ -56,17 +54,15 @@
createResultsObserver: function(mainGoogleNode) {
this.resultsObserver = new MutationObserver(() => {
chrome.runtime.sendMessage({ event: this.constants.events.get_info }, info => {
var tId = info.tId;
var wId = info.wId;
const { tId, wId } = info;
this.currentUrl[wId] = this.currentUrl[wId] ? this.currentUrl[wId] : {};
this.remove(info);
});
});
this.resultsObserver.observe(mainGoogleNode, this.constants.observerConfig);
},
isSameUrl: function(currentUrl, info) {
var tId = info.tId;
var wId = info.wId;
const { tId, wId } = info;
return this.currentUrl[wId][tId] === currentUrl;
},
deleteOldGrandpaNode: function(el) {
Expand Down