Skip to content

Commit 5b40906

Browse files
committed
Switch to working MutationObserver for responding to page updates
1 parent 51c8dbf commit 5b40906

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/azdo-pr-dashboard.user.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@
155155
onPageUpdatedThrottled.flush();
156156

157157
// Call our event handler if we notice new elements being inserted into the DOM. This happens as the page is loading or updating dynamically based on user activity.
158-
$('body > div.full-size')[0].addEventListener('DOMNodeInserted', onPageUpdatedThrottled);
158+
const targetNode = $('body > div.full-size')[0];
159+
const observer = new MutationObserver(onPageUpdatedThrottled);
160+
observer.observe(targetNode, {childList: true, subtree: true});
159161
}
160162

161163
function watchForStatusCardAndMoveToRightSideBar(session) {

0 commit comments

Comments
 (0)