Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #8239: Remove hard coded YouTube script #8238

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ var braveTarget: PackageDescription.Target = .target(
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/DomainSpecific/Paged/nacl.min.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/DomainSpecific/Paged/PlaylistFolderSharingScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/DomainSpecific/Paged/FrameCheckWrapper.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/DomainSpecific/Paged/YoutubeAdblock.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Paged/CookieControlScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Paged/FarblingProtectionScript.js"),
.copy("Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Paged/MediaBackgroundingScript.js"),
Expand Down
5 changes: 0 additions & 5 deletions Sources/Brave/Frontend/Browser/DomainUserScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ enum DomainUserScript: CaseIterable {
#endif
case braveSkus
case bravePlaylistFolderSharingHelper
case youtubeAdblock

/// Initialize this script with a URL
init?(for url: URL) {
Expand Down Expand Up @@ -55,8 +54,6 @@ enum DomainUserScript: CaseIterable {
return Set(["account.brave.com",
"account.bravesoftware.com",
"account.brave.software"])
case .youtubeAdblock:
return Set(["youtube.com"])
}
}

Expand All @@ -70,8 +67,6 @@ enum DomainUserScript: CaseIterable {
case .braveTalkHelper:
return nil
#endif
case .youtubeAdblock:
return .AdblockAndTp
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ class ScriptFactory {
}

return script

case .youtubeAdblock:
let source = try makeScriptSource(of: .youtubeAdblock)
return WKUserScript(source: source, injectionTime: .atDocumentStart, forMainFrameOnly: false, in: .page)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ enum ScriptSourceType {
/// This script is a modification of the android and desktop script found here:
/// https://github.com/brave/brave-core/blob/master/components/cosmetic_filters/resources/data/content_cosmetic.ts
case selectorsPoller
/// A script for blocking youtube ads
case youtubeAdblock

var fileName: String {
switch self {
case .nacl: return "nacl.min"
case .farblingProtection: return "FarblingProtectionScript"
case .frameCheckWrapper: return "FrameCheckWrapper"
case .selectorsPoller: return "SelectorsPollerScript"
case .youtubeAdblock: return "YoutubeAdblock"
}
}

Expand Down

This file was deleted.