Nescroll docs
v1.0.0
Get help
● Use · rules.json

Updating filters remotely
fixes without an App Store release.

Optional. Put a rules.json on your own HTTPS server, set AppConfig.rulesURL, and every installed copy of your app downloads it at launch. Remote rules can only add selectors, labels and redirects; they cannot run scripts or switch built-in filters off.

Off by defaultHTTPS onlyNo user data sent

01Turn it on

  1. Host the file anywhere that serves a static file over HTTPS with status 200: your website, a CDN, a storage bucket. Keep it under 256,000 bytes.
  2. Point the app at it in AppConfig.swift:
    static let rulesURL: URL? = URL(string: "https://example.com/myapp/rules.json")
  3. Ship that app version. From then on you can change the file without a new release.

02When the app reads it

  • Once each time the app's window appears (.task in NoReelsApp.swift), with a plain GET, a 10-second timeout and no cache. No identifier or user data is sent; your server sees an ordinary request with the device's IP address.
  • A new file is accepted only if its version is greater than the version the device already has. Always raise version when you publish a change.
  • When offline, or when the file is broken, the device keeps the last good rules (stored in user defaults under rules.remote).
  • Accepted rules apply at once: open tabs reload with them. In each site tab they act as one extra filter called "Updated rules", always on and not listed in Settings.

03rules.json format

{
  "version": 2,
  "platforms": {
    "youtube": {
      "selectors": ["ytm-shorts-new-shelf"],
      "labels": [],
      "redirects": [
        { "pattern": "^/shorts2/([^/?]+)", "target": "/watch?v=$1" }
      ]
    },
    "instagram": {
      "selectors": [],
      "labels": ["Suggested for you today"],
      "redirects": []
    },
    "facebook": {
      "selectors": ["a[href^=\"/reels-new\"]"],
      "labels": ["Sponsored content"],
      "redirects": []
    }
  }
}
FieldMeaning
versionWhole number. Raise it with every change.
platformsKeys instagram, youtube, facebook. Any other key is ignored.
selectorsCSS selectors to hide (see Filters).
labelsExact feed texts whose post is hidden.
redirectspattern (regular expression over path and query) and target (a path on the same site).
Every list is optional

A site may list only selectors, only labels or only redirects; missing lists count as empty. You may leave a whole site out.

04What the app drops for safety

Before use, the file is cleaned entry by entry (RemoteRules.sanitized()), so one bad line does not break the rest:

  • Selectors that are empty, longer than 300 characters, or contain { or } (no injected CSS rules). At most 200 per site.
  • Labels that are empty or longer than 40 characters. At most 100 per site.
  • Redirects whose pattern is longer than 200 characters or is not a valid regular expression, or whose target does not start with / or contains // (no sending users to another website). At most 50 per site.

05Test before you publish

  1. Validate the JSON, for example python3 -m json.tool rules.json.
  2. Test each selector and label in Safari Web Inspector on a real device (how).
  3. Publish to a test URL first, point a debug build at it, launch the app twice and check the effect.
  4. Publish to the production URL with a higher version.

A mistake can be undone only by publishing a newer version without the bad entry; lowering version does nothing.