Of course it works, what kind of simpleton do you take me for? 😆
Just looking at the Flarum code, inserting a new node is the only reasonable way to do what you want (above it's cloned, but you could also just create the new node from scratch if preferred):
ForumApplication.ts
120. // Route the home link back home when clicked. We do not want it to register
121. // if the user is opening it in a new tab, however.
122. document.getElementById('home-link')!.addEventListener('click', (e) => {
123. if (e.ctrlKey || e.metaKey || e.which === 2) return;
124. e.preventDefault();
125. app.history.home();
126.
127. // Reload the current user so that their unread notification count is refreshed.
128. const userId = app.session.user?.id();
129. if (userId) {
130. app.store.find('users', userId);
131. m.redraw();
132. }
133. });
It's added as an anonymous function, so there's no way to remove it from the original node. Even if you could though there'd be no guarantee they wouldn't change the function name in a future version so removeEventListener() would be an unreliable way to do it.