add fingerprinting configuration
This commit is contained in:
@@ -24,6 +24,7 @@ import 'package:fast_equatable/fast_equatable.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:nullability/nullability.dart';
|
||||
import 'package:weblibre/features/user/domain/entities/fingerprint_overrides.dart';
|
||||
|
||||
part 'engine_settings.g.dart';
|
||||
|
||||
@@ -125,6 +126,7 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
required this.dohProviderUrl,
|
||||
required this.dohDefaultProviderUrl,
|
||||
required this.dohExceptionsList,
|
||||
required super.fingerprintingProtectionOverrides,
|
||||
});
|
||||
|
||||
EngineSettings.withDefaults({
|
||||
@@ -147,6 +149,7 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
String? dohProviderUrl,
|
||||
String? dohDefaultProviderUrl,
|
||||
List<String>? dohExceptionsList,
|
||||
String? fingerprintingProtectionOverrides,
|
||||
}) : queryParameterStripping =
|
||||
queryParameterStripping ?? QueryParameterStripping.disabled,
|
||||
bounceTrackingProtectionMode =
|
||||
@@ -177,6 +180,9 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
webContentIsolationStrategy ??
|
||||
WebContentIsolationStrategy.isolateHighValue,
|
||||
enterpriseRootsEnabled: enterpriseRootsEnabled ?? false,
|
||||
fingerprintingProtectionOverrides:
|
||||
fingerprintingProtectionOverrides ??
|
||||
FingerprintOverrides.defaults().toString(),
|
||||
);
|
||||
|
||||
static AddonCollection? _addonCollectionFromJson(String? json) =>
|
||||
@@ -201,5 +207,6 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
||||
dohProviderUrl,
|
||||
dohDefaultProviderUrl,
|
||||
dohExceptionsList,
|
||||
fingerprintingProtectionOverrides,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -61,6 +61,10 @@ abstract class _$EngineSettingsCWProxy {
|
||||
|
||||
EngineSettings dohExceptionsList(List<String> dohExceptionsList);
|
||||
|
||||
EngineSettings fingerprintingProtectionOverrides(
|
||||
String? fingerprintingProtectionOverrides,
|
||||
);
|
||||
|
||||
/// Creates a new instance with the provided field values.
|
||||
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `EngineSettings(...).copyWith.fieldName(value)`.
|
||||
///
|
||||
@@ -88,6 +92,7 @@ abstract class _$EngineSettingsCWProxy {
|
||||
String dohProviderUrl,
|
||||
String dohDefaultProviderUrl,
|
||||
List<String> dohExceptionsList,
|
||||
String? fingerprintingProtectionOverrides,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -188,6 +193,13 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
||||
EngineSettings dohExceptionsList(List<String> dohExceptionsList) =>
|
||||
call(dohExceptionsList: dohExceptionsList);
|
||||
|
||||
@override
|
||||
EngineSettings fingerprintingProtectionOverrides(
|
||||
String? fingerprintingProtectionOverrides,
|
||||
) => call(
|
||||
fingerprintingProtectionOverrides: fingerprintingProtectionOverrides,
|
||||
);
|
||||
|
||||
@override
|
||||
/// Creates a new instance with the provided field values.
|
||||
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `EngineSettings(...).copyWith.fieldName(value)`.
|
||||
@@ -218,6 +230,7 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
||||
Object? dohProviderUrl = const $CopyWithPlaceholder(),
|
||||
Object? dohDefaultProviderUrl = const $CopyWithPlaceholder(),
|
||||
Object? dohExceptionsList = const $CopyWithPlaceholder(),
|
||||
Object? fingerprintingProtectionOverrides = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return EngineSettings(
|
||||
javascriptEnabled: javascriptEnabled == const $CopyWithPlaceholder()
|
||||
@@ -319,6 +332,11 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
||||
? _value.dohExceptionsList
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dohExceptionsList as List<String>,
|
||||
fingerprintingProtectionOverrides:
|
||||
fingerprintingProtectionOverrides == const $CopyWithPlaceholder()
|
||||
? _value.fingerprintingProtectionOverrides
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: fingerprintingProtectionOverrides as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -388,12 +406,16 @@ EngineSettings _$EngineSettingsFromJson(Map<String, dynamic> json) =>
|
||||
dohExceptionsList: (json['dohExceptionsList'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
fingerprintingProtectionOverrides:
|
||||
json['fingerprintingProtectionOverrides'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$EngineSettingsToJson(
|
||||
EngineSettings instance,
|
||||
) => <String, dynamic>{
|
||||
'userAgent': instance.userAgent,
|
||||
'fingerprintingProtectionOverrides':
|
||||
instance.fingerprintingProtectionOverrides,
|
||||
'javascriptEnabled': instance.javascriptEnabled,
|
||||
'trackingProtectionPolicy':
|
||||
_$TrackingProtectionPolicyEnumMap[instance.trackingProtectionPolicy]!,
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import 'package:fast_equatable/fast_equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'rfp_target.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class RFPTarget with FastEquatable {
|
||||
final String name;
|
||||
final int id;
|
||||
final String? description;
|
||||
final List<String> keywords;
|
||||
|
||||
RFPTarget({
|
||||
required this.name,
|
||||
required this.id,
|
||||
this.description,
|
||||
required this.keywords,
|
||||
});
|
||||
|
||||
factory RFPTarget.fromJson(Map<String, dynamic> json) =>
|
||||
_$RFPTargetFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$RFPTargetToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [name, id, description, keywords];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'rfp_target.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RFPTarget _$RFPTargetFromJson(Map<String, dynamic> json) => RFPTarget(
|
||||
name: json['name'] as String,
|
||||
id: (json['id'] as num).toInt(),
|
||||
description: json['description'] as String?,
|
||||
keywords: (json['keywords'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RFPTargetToJson(RFPTarget instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
'id': instance.id,
|
||||
'description': instance.description,
|
||||
'keywords': instance.keywords,
|
||||
};
|
||||
Reference in New Issue
Block a user