Mottie / GitHub-userscripts

Userscripts to add functionality to GitHub

Home Page:https://greasyfork.org/en/users/24847

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"GitHub Diff Filename" only work when reloading on the diff page

luzianscherrer opened this issue · comments

I was trying out your "GitHub Diff Filename" userscript. It is only working when I explicitly reload the diff page in the browser once I have navigated there. Are you still maintaining this script and could you give me a hint how to modify it in order to apply the changes without having to manually reload on the diff page?

Hi @luzianscherrer!

I am still maintaining it, but I've been distracted by so many other things.

I think the issue is effecting more than just this userscript. When I move to a different view, it "seems" like the page is reloading, but the document readyState doesn't change, and the mutation observer doesn't catch any changes even though the entire page reloaded. I feel like this might be a bug in Tampermonkey? Unless you're using a different userscript manager, then I need more time to investigate.

It must have something to do with the fact that you are attaching the MutationObserver to document.querySelector("body") I think. That MutationObserver gets lost on certain pages. I'm not very well versed in web technology but maybe they are removing all observers on certain actions or something like that?

If I attach the MutationObserver to document then the mutuations are coming through.

Hiya! Sorry for the delay, please check to verify that this userscript is now working as expected.

Yes, I can confirm that with version 1.1.6 it is now working fine. Thanks a lot!