uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
916 stars 78 forks source link

HTML filters don't work on first page opened after browser start #3222

Open jackrjli opened 4 months ago

jackrjli commented 4 months ago

Prerequisites

I tried to reproduce the issue when...

Description

My HTML filters do not work on the first site I visit after opening the browser. If I visit some other page first, even in a different tab, or if I refresh the page after visiting it, the filters do work. The filters also work on the first page visit if I convert them to cosmetic filters. When the issue occurs, the logger shows the page load but does not show the filter being applied.

A specific URL where the issue occurs.

http://example.com

Steps to Reproduce

  1. Add the following rule to "My filters": example.com##^h1
  2. Set homepage to "Blank page" in Firefox settings
  3. Restart Firefox
  4. Go to example.com before any other sites

Expected behavior

HTML filter removes the heading element saying "Example Domain"

Actual behavior

"Example Domain" heading remains on the page until refreshing or revisiting the page

uBO version

1.57.2

Browser name and version

Firefox 125.0

Operating System and version

Fedora 39, macOS Sonoma 14.4.1

gorhill commented 4 months ago

uBO's onHeadersReceived listener is not being called when the page loads. From a quick investigation, this appears related to the browser cache. I can reproduce easily, but not when I "Clear Data..."/"Cache Web Content" beforehand.

solsticedhiver commented 4 months ago

I am not sure this is the same issue; but today running chromium, I got no site loading at all, while it is fine in firefox. Works by disabling ublock origin.

gwarser commented 4 months ago

Internal: https://github.com/uBlockOrigin/uBlock-discussions/discussions/447#discussion-452-comment-4

gwarser commented 4 months ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1806476

gwarser commented 4 months ago

@solsticedhiver https://www.reddit.com/r/uBlockOrigin/comments/1bzpxpr/cannot_load_anything_with_ublockorigin_turned_on/

garry-ut99 commented 4 months ago

this appears related to the browser cache. I can reproduce easily, but not when I "Clear Data..."/"Cache Web Content" beforehand.

Are you sure, because on Windows + FF 125 I can still reproduce the issue even with browser data/cache cleared (regardless of whether cleared before closing browser or before visiting example.com or even when doing both) Or maybe there is a difference between Linux / Windows, as most likely you tested on Linux.

stephenhawk8054 commented 4 months ago

@solsticedhiver Please do the steps described in this: https://github.com/uBlockOrigin/uBlock-issues/issues/3217#issuecomment-2063911578 and continue in that thread instead