Bug 162057 - Content Blocker 'css-display-none' rules aren't applied when you open a website first time (from the address bar)
Summary: Content Blocker 'css-display-none' rules aren't applied when you open a websi...
Status: RESOLVED DUPLICATE of bug 170707
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: Mac Other
: P2 Major
Assignee: Nobody
Depends on:
Reported: 2016-09-16 03:45 PDT by Andrey Meshkov
Modified: 2021-05-19 16:41 PDT (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Meshkov 2016-09-16 03:45:12 PDT
#### My configuration:
Safari Version 10.0 (12602.
macOS Sierra 10.12 (16A323)

#### Steps to reproduce

1. Register a simple content blocker:
[{ "trigger": { "url-filter": ".*" }, "action": { "type": "css-display-none", "selector": "body" } }]

2. Open a new tab
3. Enter "google.com" (or any other website) and press Enter

#### Expected result
Page is empty

#### Actual result
Page is not empty. The rule will be applied after you refresh the page.

Relevant bug reports:

Also there was a similar issue with searching from the address bar:
Comment 1 Alex Christensen 2016-10-04 15:15:22 PDT
Comment 2 Andrey Meshkov 2016-11-08 10:00:19 PST
Hi Alex!

Is there any update on this issue?
Is there anything I can do/provide that might help you?
Comment 3 rx100 2016-11-15 04:01:43 PST
I have the same problem = (
Comment 4 Andrey Meshkov 2016-11-26 07:12:44 PST
After all it appears that the bug is not that serious.

It exists only in case if "trigger" contains "resource-type" field:
        "trigger": {
            "url-filter": ".*",
            "resource-type": ["document"]
        "action": {
            "type": "css-display-none",
            "selector": "any selector"

Removing "resource-type" fixes the issue. This is still a bit weird, though.
Comment 5 Maciej Stachowiak 2020-02-19 02:39:44 PST
This is indeed pretty weird.
Comment 6 Sam Sneddon [:gsnedders] 2021-05-19 16:41:41 PDT

*** This bug has been marked as a duplicate of bug 170707 ***