implement custom tracking policy

This commit is contained in:
Fabian Freund
2026-01-22 09:08:50 +01:00
parent fe1b20af1b
commit 84e1fa37e0
16 changed files with 1513 additions and 315 deletions
+4 -3
View File
@@ -56,6 +56,7 @@ import 'package:weblibre/features/settings/presentation/screens/addon_collection
import 'package:weblibre/features/settings/presentation/screens/advanced_settings.dart';
import 'package:weblibre/features/settings/presentation/screens/appearance_display_settings.dart';
import 'package:weblibre/features/settings/presentation/screens/bang_settings.dart';
import 'package:weblibre/features/settings/presentation/screens/custom_tracking_protection.dart';
import 'package:weblibre/features/settings/presentation/screens/doh_settings.dart';
import 'package:weblibre/features/settings/presentation/screens/error_logs_screen.dart';
import 'package:weblibre/features/settings/presentation/screens/fingerprint_settings.dart';
@@ -82,11 +83,11 @@ import 'package:weblibre/features/web_feed/presentation/screens/feed_edit.dart';
import 'package:weblibre/features/web_feed/presentation/screens/feed_list.dart';
import 'package:weblibre/features/web_feed/presentation/select_feed_dialog.dart';
part 'routes.bangs.dart';
part 'routes.browser.dart';
part 'routes.feeds.dart';
part 'routes.g.dart';
part 'routes.settings.dart';
part 'routes.browser.dart';
part 'routes.bangs.dart';
part 'routes.feeds.dart';
@TypedGoRoute<AboutRoute>(name: 'AboutRoute', path: '/about')
class AboutRoute extends GoRouteData with $AboutRoute {
+27
View File
@@ -151,6 +151,11 @@ RouteBase get $settingsRoute => GoRouteData.$route(
name: 'TrackingProtectionExceptionsRoute',
factory: $TrackingProtectionExceptionsRoute._fromState,
),
GoRouteData.$route(
path: 'custom_tracking_protection',
name: 'CustomTrackingProtectionRoute',
factory: $CustomTrackingProtectionRoute._fromState,
),
GoRouteData.$route(
path: 'error_logs',
name: 'ErrorLogsRoute',
@@ -478,6 +483,28 @@ mixin $TrackingProtectionExceptionsRoute on GoRouteData {
void replace(BuildContext context) => context.replace(location);
}
mixin $CustomTrackingProtectionRoute on GoRouteData {
static CustomTrackingProtectionRoute _fromState(GoRouterState state) =>
CustomTrackingProtectionRoute();
@override
String get location =>
GoRouteData.$location('/settings/custom_tracking_protection');
@override
void go(BuildContext context) => context.go(location);
@override
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
@override
void pushReplacement(BuildContext context) =>
context.pushReplacement(location);
@override
void replace(BuildContext context) => context.replace(location);
}
mixin $ErrorLogsRoute on GoRouteData {
static ErrorLogsRoute _fromState(GoRouterState state) => ErrorLogsRoute();
+12
View File
@@ -75,6 +75,10 @@ part of 'routes.dart';
name: 'TrackingProtectionExceptionsRoute',
path: 'tracking_protection_exceptions',
),
TypedGoRoute<CustomTrackingProtectionRoute>(
name: 'CustomTrackingProtectionRoute',
path: 'custom_tracking_protection',
),
TypedGoRoute<ErrorLogsRoute>(name: 'ErrorLogsRoute', path: 'error_logs'),
],
)
@@ -202,3 +206,11 @@ class ErrorLogsRoute extends GoRouteData with $ErrorLogsRoute {
return const ErrorLogsScreen();
}
}
class CustomTrackingProtectionRoute extends GoRouteData
with $CustomTrackingProtectionRoute {
@override
Widget build(BuildContext context, GoRouterState state) {
return const CustomTrackingProtectionScreen();
}
}