#Element removal

15 messages · Page 1 of 1 (latest)

vague beacon
#

remove it after logout

karmic basin
#

or how to listen for element creation

vague beacon
#

i suppose you know when you navigate to other page

#

there is no event for that

karmic basin
vague beacon
#

so?

karmic basin
#

Original code

    mainWindow.webContents.executeJavaScript(`
      const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
          if (mutation.addedNodes.length) {
            mutation.addedNodes.forEach((node) => {
              if (node.classList && node.classList.contains('item-link1')) {
                node.remove();
              }
            });
          }
        });
      });
      observer.observe(document.body, {
        childList: true,
        subtree: true,
      });
    `);
  });```
#

How can I detect navigation then

vague beacon
#

with navigation event

karmic basin
#

but it doesn't help

vague beacon
#

there is did-navigate-in-page also

karmic basin
#

Didn't help

vague beacon
#

then its not possible