Skip to content

Scriptlet PoC #3014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Scriptlet PoC #3014

wants to merge 15 commits into from

Conversation

jonathanKingston
Copy link
Collaborator

Asana Task/Github Issue:

Description

Feature change process:

  • I have added a schema to validate this feature change
  • I have tested this change locally
  • This code for the config change is ready to merge
  • This feature was covered by a tech design

Additional info:

  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • This code for the config change is ready
  • This change was covered by a ship review

Site breakage mitigation process:

Brief explanation

  • Reported URL:

  • Problems experienced:

  • Platforms affected:

    • iOS
    • Android
    • Windows
    • MacOS
    • Extensions
  • Tracker(s) being unblocked:

  • Feature being disabled:

  • I have referenced the URL of this PR as the "reason" value for the exception (where applicable).

  • This change is a speculative mitigation to fix reported breakage.

Reference

Copy link

Don't forget to add an individual reviewer (in addition to those already added, this should create a task for them in Asana).
- The best reviewer is most likely a feature or platform owner.
- If they've got permission to approve, you're good to merge. See CODEOWNERS
- As a fallback the Global owners are:
- Breakage AOR
- Breakage triagers
- Config AOR
Please mark this as draft unless there's intention to merge this.
Click the "Merge When Ready" if you're happy for this to automatically get merged once reviewed.
- If the option isn't available to you; ensure you've signed into DuckDuckGo oauth.
Also don't forget to add schema changes to validate if you're adding/changing a feature.

github-actions bot pushed a commit that referenced this pull request Apr 19, 2025
Copy link

github-actions bot commented Apr 19, 2025

Generated file outputs:

Time updated: Thu, 24 Apr 2025 12:35:21 GMT

legacy
trackers-unprotected-temporary.txt

⚠️ File is identical

v3/android-config.json (13 more)
  • v3/android-config.json
  • v3/extension-brave-config.json
  • v3/extension-bravemv3-config.json
  • v3/extension-chrome-config.json
  • v3/extension-chromemv3-config.json
  • v3/extension-config.json
  • v3/extension-edg-config.json
  • v3/extension-edge-config.json
  • v3/extension-edgmv3-config.json
  • v3/extension-firefox-config.json
  • v3/extension-safarimv3-config.json
  • v3/ios-config.json
  • v3/macos-config.json
  • v3/windows-config.json
--- v3/windows-config.json
+++ v3/windows-config.json
@@ -7156,8 +7156,237 @@
                 }
             ],
             "settings": {}
         },
+        "scriptlets": {
+            "state": "enabled",
+            "exceptions": [],
+            "settings": {
+                "scriptlets": [
+                    {
+                        "name": "setConstant",
+                        "attrs": {
+                            "property": "test",
+                            "value": "no"
+                        }
+                    },
+                    {
+                        "name": "abortCurrentInlineScript",
+                        "attrs": {
+                            "property": "test",
+                            "search": "test"
+                        }
+                    },
+                    {
+                        "name": "abortOnPropertyRead",
+                        "attrs": {
+                            "property": "test"
+                        }
+                    },
+                    {
+                        "name": "abortOnPropertyWrite",
+                        "attrs": {
+                            "property": "test"
+                        }
+                    }
+                ],
+                "conditionalChanges": [
+                    {
+                        "condition": {
+                            "domain": "example.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "trustedReplaceNodeText",
+                                    "attrs": {
+                                        "nodeName": "a",
+                                        "textMatch": "More information...",
+                                        "pattern": "...",
+                                        "replacement": "!",
+                                        "extraArgs": [
+                                            "verbose"
+                                        ]
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "trustedSetAttr",
+                                    "attrs": {
+                                        "selector": "a",
+                                        "attr": "href",
+                                        "value": "#"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setCookie",
+                                    "attrs": {
+                                        "domain": "example.com",
+                                        "name": "test",
+                                        "value": "accepted"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "removeCookie",
+                                    "attrs": {
+                                        "domain": "example.com",
+                                        "match": "bloop"
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": {
+                            "domain": "xnxx.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "preventAddEventListener",
+                                    "attrs": {
+                                        "typeSearch": "DOMContentLoaded",
+                                        "listenerSearch": "/dyn\\.ads|loadAdsDelayed/"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "xv.sda.pp.init",
+                                        "value": "noopFunc"
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": {
+                            "domain": "pornhub.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setCookie",
+                                    "attrs": {
+                                        "name": "views",
+                                        "value": "1"
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": [
+                            {
+                                "domain": "redtube.com"
+                            },
+                            {
+                                "domain": "redtube.net"
+                            }
+                        ],
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "preventWindowOpen"
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "abortCurrentInlineScript",
+                                    "attrs": {
+                                        "property": "Object.defineProperty",
+                                        "search": "trafficjunky"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "page_params.holiday_promo",
+                                        "value": true
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": {
+                            "domain": "spankbang.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "preventWindowOpen"
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "BJSShowUnder",
+                                        "value": {}
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "BJSShowUnder.bindTo",
+                                        "value": "noopFunc"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "BJSShowUnder.add",
+                                        "value": "noopFunc"
+                                    }
+                                }
+                            }
+                        ]
+                    }
+                ]
+            }
+        },
         "sendFullPackageInstallSource": {
             "state": "enabled",
             "settings": {},
             "exceptions": []
latest
v4/android-config.json (13 more)
  • v4/android-config.json
  • v4/extension-brave-config.json
  • v4/extension-bravemv3-config.json
  • v4/extension-chrome-config.json
  • v4/extension-chromemv3-config.json
  • v4/extension-config.json
  • v4/extension-edg-config.json
  • v4/extension-edge-config.json
  • v4/extension-edgmv3-config.json
  • v4/extension-firefox-config.json
  • v4/extension-safarimv3-config.json
  • v4/ios-config.json
  • v4/macos-config.json
  • v4/windows-config.json
--- v4/windows-config.json
+++ v4/windows-config.json
@@ -6604,8 +6604,237 @@
                 }
             ],
             "settings": {}
         },
+        "scriptlets": {
+            "state": "enabled",
+            "exceptions": [],
+            "settings": {
+                "scriptlets": [
+                    {
+                        "name": "setConstant",
+                        "attrs": {
+                            "property": "test",
+                            "value": "no"
+                        }
+                    },
+                    {
+                        "name": "abortCurrentInlineScript",
+                        "attrs": {
+                            "property": "test",
+                            "search": "test"
+                        }
+                    },
+                    {
+                        "name": "abortOnPropertyRead",
+                        "attrs": {
+                            "property": "test"
+                        }
+                    },
+                    {
+                        "name": "abortOnPropertyWrite",
+                        "attrs": {
+                            "property": "test"
+                        }
+                    }
+                ],
+                "conditionalChanges": [
+                    {
+                        "condition": {
+                            "domain": "example.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "trustedReplaceNodeText",
+                                    "attrs": {
+                                        "nodeName": "a",
+                                        "textMatch": "More information...",
+                                        "pattern": "...",
+                                        "replacement": "!",
+                                        "extraArgs": [
+                                            "verbose"
+                                        ]
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "trustedSetAttr",
+                                    "attrs": {
+                                        "selector": "a",
+                                        "attr": "href",
+                                        "value": "#"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setCookie",
+                                    "attrs": {
+                                        "domain": "example.com",
+                                        "name": "test",
+                                        "value": "accepted"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "removeCookie",
+                                    "attrs": {
+                                        "domain": "example.com",
+                                        "match": "bloop"
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": {
+                            "domain": "xnxx.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "preventAddEventListener",
+                                    "attrs": {
+                                        "typeSearch": "DOMContentLoaded",
+                                        "listenerSearch": "/dyn\\.ads|loadAdsDelayed/"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "xv.sda.pp.init",
+                                        "value": "noopFunc"
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": {
+                            "domain": "pornhub.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setCookie",
+                                    "attrs": {
+                                        "name": "views",
+                                        "value": "1"
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": [
+                            {
+                                "domain": "redtube.com"
+                            },
+                            {
+                                "domain": "redtube.net"
+                            }
+                        ],
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "preventWindowOpen"
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "abortCurrentInlineScript",
+                                    "attrs": {
+                                        "property": "Object.defineProperty",
+                                        "search": "trafficjunky"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "page_params.holiday_promo",
+                                        "value": true
+                                    }
+                                }
+                            }
+                        ]
+                    },
+                    {
+                        "condition": {
+                            "domain": "spankbang.com"
+                        },
+                        "patchSettings": [
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "preventWindowOpen"
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "BJSShowUnder",
+                                        "value": {}
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "BJSShowUnder.bindTo",
+                                        "value": "noopFunc"
+                                    }
+                                }
+                            },
+                            {
+                                "op": "add",
+                                "path": "/scriptlets/-",
+                                "value": {
+                                    "name": "setConstant",
+                                    "attrs": {
+                                        "property": "BJSShowUnder.add",
+                                        "value": "noopFunc"
+                                    }
+                                }
+                            }
+                        ]
+                    }
+                ]
+            }
+        },
         "sendFullPackageInstallSource": {
             "state": "enabled",
             "settings": {},
             "exceptions": []

github-actions bot pushed a commit that referenced this pull request Apr 21, 2025
github-actions bot pushed a commit that referenced this pull request Apr 21, 2025
github-actions bot pushed a commit that referenced this pull request Apr 21, 2025
github-actions bot pushed a commit that referenced this pull request Apr 21, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
github-actions bot pushed a commit that referenced this pull request Apr 24, 2025
github-actions bot pushed a commit that referenced this pull request Apr 24, 2025
github-actions bot pushed a commit that referenced this pull request Apr 24, 2025
github-actions bot pushed a commit that referenced this pull request Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant