Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug : Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'. #5

Open
jerome-renaud opened this issue Mar 18, 2020 · 0 comments

Comments

@jerome-renaud
Copy link

jerome-renaud commented Mar 18, 2020

Contexte
https://intra.epitech.eu/module/2019/G-JAM-001/TLS-0-2/registered
Trace de la pile
scripts/activity.js:26 (fonction anonyme)
`(() => {
if (document.location.href.endsWith('/registered')) {
console.log("Intra refined Setup: ACTIVITY");

    const list_inscrit_table = document.getElementById('list-inscrit');
    let button = null
    function upsertTeamsButton() {
        const buttons_container = Array.from(document.getElementsByClassName('admin')).find((e, id) => id === 0);
        if (!buttons_container) return;
        const students = Array.from(list_inscrit_table.getElementsByTagName('td')).filter((e) => e.dataset.login).map((e) => e.dataset.login)
        if (students.length === 0) return;
        if (button !== null) {
            buttons_container.removeChild(button)
        }
        button = createButtonTeams(students)
        buttons_container.appendChild(button)
    }

    // Create an observer instance linked to the callback function
    const observer = new MutationObserver((mutationsList, observer) => {
        upsertTeamsButton();
    });

    // Start observing the target node for configured mutations
    upsertTeamsButton();
   observer.observe(list_inscrit_table, { childList: true, subtree: true }); // <--- ici
    //*/
}

})();`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant