mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-01 00:02:55 +01:00
feat(YouTube): Add Remove tracking query parameter
patch
Implementation references taken from github.com/inotia00/revanced-patches/commit/4037d9c85b7e37f8635f8fdcc1efea85dcddb5e2.
This commit is contained in:
parent
db0fb46a39
commit
e84b7b328e
@ -0,0 +1,16 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public final class RemoveTrackingQueryParameterPatch {
|
||||
private static final String NEW_TRACKING_PARAMETER_REGEX = ".si=.+";
|
||||
private static final String OLD_TRACKING_PARAMETER_REGEX = ".feature=.+";
|
||||
|
||||
public static String sanitize(String url) {
|
||||
if (!SettingsEnum.REMOVE_TRACKING_QUERY_PARAMETER.getBoolean()) return url;
|
||||
|
||||
return url
|
||||
.replaceAll(NEW_TRACKING_PARAMETER_REGEX, "")
|
||||
.replaceAll(OLD_TRACKING_PARAMETER_REGEX, "");
|
||||
}
|
||||
}
|
@ -190,6 +190,7 @@ public enum SettingsEnum {
|
||||
ANNOUNCEMENTS("revanced_announcements", BOOLEAN, TRUE),
|
||||
ANNOUNCEMENT_CONSUMER("revanced_announcement_consumer", STRING, ""),
|
||||
ANNOUNCEMENT_LAST_HASH("revanced_announcement_last_hash", STRING, ""),
|
||||
REMOVE_TRACKING_QUERY_PARAMETER("revanced_remove_tracking_query_parameter", BOOLEAN, TRUE),
|
||||
|
||||
// Swipe controls
|
||||
SWIPE_BRIGHTNESS("revanced_swipe_brightness", BOOLEAN, TRUE),
|
||||
|
Loading…
Reference in New Issue
Block a user