Questions tagged [safari-content-blocker]

This tag should be used with questions about the safari-content-blocker extension (iOS and OS X).

The safari-content-blocker extension is available for booth iOS and Mac OS X. Content on websites such as javascript, css-elements, images and other files can be blocked from loading.

49 questions
1
vote
1 answer

Using multiple JSON lists in iOS Content Blocker

I am trying to create my own content blocker on iOS. I was wanting to create separate json lists for different types of content (tracking, ads, adult sites, etc). I came across this https://github.com/calebhicks/ios-safari-content-blocking which…
spearman008
  • 87
  • 1
  • 8
1
vote
0 answers

Any limitation to block website using content blocker extension in mobile Safari

i have more then fifteen thousand of website and i want block using content blocker extension in son formate like this [{ "action": { "type": "block" }, "trigger": { "url-filter": ".*apple.*" } }, { "action": …
ikbal
  • 1,114
  • 1
  • 11
  • 30
1
vote
1 answer

Safari OS X "block-cookies" content blocking rule

I'm trying to create a simple extension for Safari in OS X that whitelists domains for setting cookies. The documentation indicates that this is possible with the "block-cookies" action type. When I try to use it, however, it does nothing. I'm…
mike
  • 31
  • 3
1
vote
0 answers

iOS 9 Content Filter replace occurrences of string

I am trying to make a content filter that censors webpages automatically by replacing the text of webpages with better alternatives ($'s and *'s in place of expletives, for example). I found this pretty easy to do when creating an action extension,…
erdekhayser
  • 6,537
  • 2
  • 37
  • 69
1
vote
1 answer

iOS Content Blocker not working on iPad (fine on iPhone)

I have just made an Content Blocker to block some information in Safari (something like adBlock, but not block ad), and everything works fine on iPhone Simulator and my iPhone 6S, but though I can open the content blocker in Settings -> Safari ->…
Kaiyuan Xu
  • 780
  • 7
  • 13
1
vote
2 answers

Optional(Error Domain=ContentBlockerErrorDomain Code=1 "(null)")

I get the following error while load the json file with SFContentBlockerManager.reloadContentBlockerWithIdentifie Optional(Error Domain=ContentBlockerErrorDomain Code=1 "(null)") // This is my code to get attachment let documentDirectoryURL =…
1
vote
1 answer

How do I know if my iOS Safari content blocker is enabled?

Is there an iOS API that would tell me if my content blocker for Safari is enabled? Or do I have to resort to some kind of heuristics if I want to know that?
zoul
  • 102,279
  • 44
  • 260
  • 354
1
vote
0 answers

Accessing file within Safari extension from app

I'm building safari content blocker (xcode 7 beta 4). In app I use SFContentBlockerManager.reloadContentBlockerWithIdentifier to actualize blockerList.json file, but I can't access it to rewrite with new rules. let dir =…
Wayne
  • 333
  • 1
  • 8
  • 19
0
votes
0 answers

How to create a content blocker for ios?

Pre-requisites: Xcode: 14 iOS: 16 Device: iPhone 14 Trying to create a simple content blocker using the content blocker extension from the Xcode. Steps to reproduce: Create a simple Xcode Project. Add a new target -> Content blocker extension Give…
0
votes
1 answer

Select CSS Parent `selector` in iOS Content Blocking

I am setting up some content blockers (https://developer.apple.com/documentation/safariservices/creating_a_content_blocker) The HTML I am testing on looks something like this:
Jonovono
  • 1,979
  • 7
  • 30
  • 53
0
votes
1 answer

SwiftUI: How to apply content blocker to chrome?

I'm currently working with the content blocker Extension which works just fine for Safari. But does anyone know if it can also be applied to Chrome, if so how? Another question I have: Is it possible to block an app, with the content blocker…
Nick
  • 219
  • 4
  • 15
0
votes
1 answer

Safari macOS content blocker only works once

Strange problem. I'm building a safari content blocker. When I run the host app the content block extension appears in the safari extensions preference window. Everything works fine. Except, it only works the first time I run it. Subsequent times…
Vimy
  • 142
  • 2
  • 9
0
votes
1 answer

How limited is support for Level 4 in Safari Content Blockers?

Back in 2015 when Safari Content Blockers were released it was said that they support CSS Selectors Level 4 expressions. However even today they don't support at least the :has() operator. What parts of Level4-only specification does Safari actually…
wass rubleff
  • 326
  • 1
  • 14
0
votes
1 answer

iOS content block extension with renewable subscription

I’m having hard time thinking of a solution to my problem, I want to block the content blocker usability when the renewable subscription is not active, I have the related code that checks if the subscription is still active inside the app extension…
0
votes
1 answer

Content Blocker - Swift | iOS

I'm trying to retrieve an URL when the user is visiting a website on Safari. I had the idea to use Content Blocker but I don't find any method to get the URL of a web site in my blockList.json file. I tried to print something in…
fredericdnd
  • 968
  • 1
  • 14
  • 25