Created
August 6, 2021 09:18
-
-
Save msoxzw/b2215d8407eae8ec1880ef6bb0f43076 to your computer and use it in GitHub Desktop.
Add Internet Explorer Tracking Protection Lists from known Adblock Plus subscriptions and by language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Push-Location $PSScriptRoot | |
$subscriptionsURL = 'https://raw.githubusercontent.com/adblockplus/adblockpluscore/master/data/subscriptions.json' | |
$subscriptions = Invoke-WebRequest $subscriptionsURL | ConvertFrom-Json | |
$language = (Get-UICulture).TwoLetterISOLanguageName | |
if ($language -notin $subscriptions.languages) {$language = 'en'} | |
$registryPath = 'HKCU:\Software\Microsoft\Internet Explorer\Safety\PrivacIE\Lists' | |
$added = Get-ItemPropertyValue "$registryPath\*" 'Name' | |
$subscriptions | Where-Object {$_.title -notin $added -and ($null -eq $_.languages -or $language -in $_.languages)} | ForEach-Object {[PSCustomObject]@{'Enabled' = 1; 'Name' = $_.title; 'Url' = $_.url -replace '\.txt$','.tpl'} | Set-ItemProperty (New-Item $registryPath -Name "{$(New-Guid)}".ToUpper() -Force).PSPath} | |
Pop-Location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment