Greasy Fork镜像 is available in English.

Facebook Anti-Refresh

Prevents Facebook from auto-refreshing the news feed

Αυτές είναι εκδόσεις αυτού του κώδικα όπου ο κώδικας έχει ενημερωθεί. Προβολή όλων των εκδόσεων.

  • v1.2 02/06/2025

    Version 1.2 (June 2, 2025)

    🆕 What's New

    Fixed the script completely freezing Facebook. Yeah, that was bad.

    🐛 Bug Fixes

    • Fixed "Cannot assign to read only property 'reload'" error - Removed the location.reload override that was causing TypeError spam in console
    • Fixed Facebook becoming unresponsive - Removed overly aggressive MutationObservers that were watching every single DOM change
    • Fixed performance issues - Removed the 5-second re-application loop that was hammering the CPU for no reason

    🔧 Technical Changes

    • Simplified network interception - Now only blocks specific refresh endpoints instead of analyzing every request to Facebook
    • Removed unnecessary features that were causing more harm than good:
      • WebSocket interception (wasn't helping with refresh anyway)
      • Service Worker blocking (overkill)
      • Aggressive script injection monitoring
    • Better error handling - Added try-catch blocks so one error doesn't break everything
    • Lighter activity tracking - Only tracks essential user interactions (click, scroll, keypress)

    📈 Performance

    • Before: Facebook freezing, console errors, high CPU usage
    • After: Smooth experience, minimal overhead, no errors

    💡 Developer Notes

    Turns out trying to block EVERYTHING Facebook does is a terrible idea. This version takes a much more targeted approach - only blocking what's actually needed to prevent the refresh. If it works, don't touch it!

  • v1.1 13/05/2025

    facebook anti-refresh: fix typo

  • v1.0 13/05/2025

    facebook anti-refresh: fix various known bug, approach with another method

  • v1.0 13/05/2025 Imported from URL

长期地址
遇到问题?请前往 GitHub 提 Issues。