Skip to content

Commit

Permalink
Remove unnecessary variable redefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
bijij committed Feb 3, 2020
1 parent d624484 commit 8cc942f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ var observer = new MutationObserver(function (mutations) {
if (DEBUG)
console.log('ViewImage: Mutations detected: ', mutations);

var node;
for (var mutation of mutations) {
if (mutation.addedNodes && mutation.addedNodes.length > 0) {
for (var node of mutation.addedNodes) {
for (node of mutation.addedNodes) {
if (node.classList) {
// Check for new image nodes
if (['irc_mi', 'irc_mut', 'irc_ris', 'n3VNCb'].some(className => node.classList.contains(className))) {
Expand All @@ -338,7 +339,7 @@ var observer = new MutationObserver(function (mutations) {
}

if (mutation.target.classList && mutation.target.classList.contains('n3VNCb')) {
var node = mutation.target.closest('.tvh9oe');
node = mutation.target.closest('.tvh9oe');

if (!node.hasAttribute('aria-hidden')) {
addLinks(node);
Expand Down

0 comments on commit 8cc942f

Please sign in to comment.