refactor setting providers; include content blocking settings;
This commit is contained in:
@@ -90,10 +90,6 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"title": "Disable GIO as a potential proxy bypass vector"
|
"title": "Disable GIO as a potential proxy bypass vector"
|
||||||
},
|
},
|
||||||
"media.peerconnection.ice.proxy_only_if_behind_proxy": {
|
|
||||||
"value": true,
|
|
||||||
"title": "Force WebRTC inside the proxy"
|
|
||||||
},
|
|
||||||
"media.peerconnection.enabled": {
|
"media.peerconnection.enabled": {
|
||||||
"value": false,
|
"value": false,
|
||||||
"title": "Disable WebRTC PeerConnection",
|
"title": "Disable WebRTC PeerConnection",
|
||||||
@@ -199,18 +195,6 @@
|
|||||||
"title": "Disable automatic User Agent updates",
|
"title": "Disable automatic User Agent updates",
|
||||||
"description": "This preference controls whether Firefox automatically updates its User-Agent string. When set to false, it prevents Firefox from automatically updating the browser's User-Agent string, which is a text identifier that tells websites which browser and version you're using."
|
"description": "This preference controls whether Firefox automatically updates its User-Agent string. When set to false, it prevents Firefox from automatically updating the browser's User-Agent string, which is a text identifier that tells websites which browser and version you're using."
|
||||||
},
|
},
|
||||||
"privacy.query_stripping.enabled": {
|
|
||||||
"value": true,
|
|
||||||
"title": "Strip known tracking query parameters from URLs"
|
|
||||||
},
|
|
||||||
"privacy.query_stripping.enabled.pbmode": {
|
|
||||||
"value": true,
|
|
||||||
"title": "Strip known tracking query parameters from URLs (Private browsing)"
|
|
||||||
},
|
|
||||||
"privacy.query_stripping.strip_list": {
|
|
||||||
"value": "__hsfp __hssc __hstc __s _bhlid _branch_match_id _branch_referrer _gl _hsenc _kx _openstat at_recipient_id at_recipient_list bbeml bsft_clkid bsft_uid dclid et_rid fb_action_ids fb_comment_id fbclid gbraid gclid guce_referrer guce_referrer_sig hsCtaTracking igshid irclickid mc_eid mkt_tok ml_subscriber ml_subscriber_hash msclkid mtm_cid oft_c oft_ck oft_d oft_id oft_ids oft_k oft_lk oft_sk oly_anon_id oly_enc_id pk_cid rb_clickid s_cid sc_customer sc_eh sc_uid srsltid ss_email_id twclid unicorn_click_id vero_conv vero_id vgo_ee wbraid wickedid yclid ymclid ysclid",
|
|
||||||
"title": "Improve built-in query stripping"
|
|
||||||
},
|
|
||||||
"dom.private-attribution.submission.enabled": {
|
"dom.private-attribution.submission.enabled": {
|
||||||
"value": false,
|
"value": false,
|
||||||
"title": "Disable Private Attribution Submission Control",
|
"title": "Disable Private Attribution Submission Control",
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ part 'bangs.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
Stream<BangData?> defaultSearchBangData(Ref ref) {
|
Stream<BangData?> defaultSearchBangData(Ref ref) {
|
||||||
final trigger = ref.watch(
|
final trigger = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.defaultSearchProvider,
|
(value) => value.defaultSearchProvider,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ part of 'bangs.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$defaultSearchBangDataHash() =>
|
String _$defaultSearchBangDataHash() =>
|
||||||
r'acce519559903505f9623f3631b6f4177a396d39';
|
r'5fa3f588b57a82dd8fffb2082e495108a242ef72';
|
||||||
|
|
||||||
/// See also [defaultSearchBangData].
|
/// See also [defaultSearchBangData].
|
||||||
@ProviderFor(defaultSearchBangData)
|
@ProviderFor(defaultSearchBangData)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class BangListScreen extends HookConsumerWidget {
|
|||||||
.setTrigger(bang.trigger);
|
.setTrigger(bang.trigger);
|
||||||
|
|
||||||
final settings = ref.read(
|
final settings = ref.read(
|
||||||
generalSettingsRepositoryProvider,
|
generalSettingsWithDefaultsProvider,
|
||||||
);
|
);
|
||||||
|
|
||||||
SearchRoute(
|
SearchRoute(
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class BangDetails extends HookConsumerWidget {
|
|||||||
final url = Uri.parse(bangData.getTemplateUrl('').origin);
|
final url = Uri.parse(bangData.getTemplateUrl('').origin);
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultCreateTabType ==
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class SiteSearch extends HookConsumerWidget {
|
|||||||
final isPrivate =
|
final isPrivate =
|
||||||
ref.read(selectedTabStateProvider)?.isPrivate ??
|
ref.read(selectedTabStateProvider)?.isPrivate ??
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultCreateTabType ==
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ GeckoSelectionActionService selectionActionService(Ref ref) {
|
|||||||
service.setActions([
|
service.setActions([
|
||||||
SearchAction((text) async {
|
SearchAction((text) async {
|
||||||
final router = await ref.read(routerProvider.future);
|
final router = await ref.read(routerProvider.future);
|
||||||
final settings = ref.read(generalSettingsRepositoryProvider);
|
final settings = ref.read(generalSettingsWithDefaultsProvider);
|
||||||
final route = SearchRoute(
|
final route = SearchRoute(
|
||||||
tabType:
|
tabType:
|
||||||
ref.read(selectedTabTypeProvider) ??
|
ref.read(selectedTabTypeProvider) ??
|
||||||
@@ -64,7 +64,7 @@ GeckoSelectionActionService selectionActionService(Ref ref) {
|
|||||||
final isPrivate =
|
final isPrivate =
|
||||||
currentTab?.isPrivate ??
|
currentTab?.isPrivate ??
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultCreateTabType ==
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ part of 'providers.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$selectionActionServiceHash() =>
|
String _$selectionActionServiceHash() =>
|
||||||
r'f356434878b46fd443c8e3a8a48cf07c34a63b70';
|
r'b1deac5e0566443b4729656c7082903b529bc269';
|
||||||
|
|
||||||
/// See also [selectionActionService].
|
/// See also [selectionActionService].
|
||||||
@ProviderFor(selectionActionService)
|
@ProviderFor(selectionActionService)
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ class TabRepository extends _$TabRepository {
|
|||||||
next.whenData((value) async {
|
next.whenData((value) async {
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultIntentTabType ==
|
.defaultIntentTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ part of 'tab.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$tabRepositoryHash() => r'fccaa6521e1bad7e8b3f82e6d611469348dc8667';
|
String _$tabRepositoryHash() => r'3465f351f1d36e0f21b4e8ef4ebe7fdc4fbc0b75';
|
||||||
|
|
||||||
/// See also [TabRepository].
|
/// See also [TabRepository].
|
||||||
@ProviderFor(TabRepository)
|
@ProviderFor(TabRepository)
|
||||||
|
|||||||
+69
-55
@@ -37,7 +37,7 @@ class EngineSettingsReplicationService
|
|||||||
|
|
||||||
ref.listen(
|
ref.listen(
|
||||||
fireImmediately: true,
|
fireImmediately: true,
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(settings) => settings.themeMode,
|
(settings) => settings.themeMode,
|
||||||
),
|
),
|
||||||
(previous, next) async {
|
(previous, next) async {
|
||||||
@@ -62,61 +62,75 @@ class EngineSettingsReplicationService
|
|||||||
fireImmediately: true,
|
fireImmediately: true,
|
||||||
engineSettingsRepositoryProvider,
|
engineSettingsRepositoryProvider,
|
||||||
(previous, next) async {
|
(previous, next) async {
|
||||||
if (initialSettingsSent && previous != null) {
|
final settings = next.valueOrNull;
|
||||||
if (previous.javascriptEnabled != next.javascriptEnabled) {
|
|
||||||
await _service.javascriptEnabled(next.javascriptEnabled);
|
if (settings != null) {
|
||||||
|
if (initialSettingsSent && previous != null) {
|
||||||
|
if (previous.valueOrNull?.javascriptEnabled !=
|
||||||
|
settings.javascriptEnabled) {
|
||||||
|
await _service.javascriptEnabled(settings.javascriptEnabled);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.trackingProtectionPolicy !=
|
||||||
|
settings.trackingProtectionPolicy) {
|
||||||
|
await _service.trackingProtectionPolicy(
|
||||||
|
settings.trackingProtectionPolicy,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.httpsOnlyMode != settings.httpsOnlyMode) {
|
||||||
|
await _service.httpsOnlyMode(settings.httpsOnlyMode);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.globalPrivacyControlEnabled !=
|
||||||
|
settings.globalPrivacyControlEnabled) {
|
||||||
|
await _service.globalPrivacyControlEnabled(
|
||||||
|
settings.globalPrivacyControlEnabled,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.preferredColorScheme !=
|
||||||
|
settings.preferredColorScheme) {
|
||||||
|
await _service.preferredColorScheme(
|
||||||
|
settings.preferredColorScheme,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.cookieBannerHandlingMode !=
|
||||||
|
settings.cookieBannerHandlingMode) {
|
||||||
|
await _service.cookieBannerHandlingMode(
|
||||||
|
settings.cookieBannerHandlingMode,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.cookieBannerHandlingModePrivateBrowsing !=
|
||||||
|
settings.cookieBannerHandlingModePrivateBrowsing) {
|
||||||
|
await _service.cookieBannerHandlingModePrivateBrowsing(
|
||||||
|
settings.cookieBannerHandlingModePrivateBrowsing,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.cookieBannerHandlingGlobalRules !=
|
||||||
|
settings.cookieBannerHandlingGlobalRules) {
|
||||||
|
await _service.cookieBannerHandlingGlobalRules(
|
||||||
|
settings.cookieBannerHandlingGlobalRules,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous
|
||||||
|
.valueOrNull
|
||||||
|
?.cookieBannerHandlingGlobalRulesSubFrames !=
|
||||||
|
settings.cookieBannerHandlingGlobalRulesSubFrames) {
|
||||||
|
await _service.cookieBannerHandlingGlobalRulesSubFrames(
|
||||||
|
settings.cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.webContentIsolationStrategy !=
|
||||||
|
settings.webContentIsolationStrategy) {
|
||||||
|
await _service.webContentIsolationStrategy(
|
||||||
|
settings.webContentIsolationStrategy,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (previous.valueOrNull?.contentBlocking !=
|
||||||
|
settings.contentBlocking) {
|
||||||
|
await _service.contentBlocking(settings.contentBlocking);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await _service.setDefaultSettings(settings);
|
||||||
|
initialSettingsSent = true;
|
||||||
}
|
}
|
||||||
if (previous.trackingProtectionPolicy !=
|
|
||||||
next.trackingProtectionPolicy) {
|
|
||||||
await _service.trackingProtectionPolicy(
|
|
||||||
next.trackingProtectionPolicy,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (previous.httpsOnlyMode != next.httpsOnlyMode) {
|
|
||||||
await _service.httpsOnlyMode(next.httpsOnlyMode);
|
|
||||||
}
|
|
||||||
if (previous.globalPrivacyControlEnabled !=
|
|
||||||
next.globalPrivacyControlEnabled) {
|
|
||||||
await _service.globalPrivacyControlEnabled(
|
|
||||||
next.globalPrivacyControlEnabled,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (previous.preferredColorScheme != next.preferredColorScheme) {
|
|
||||||
await _service.preferredColorScheme(next.preferredColorScheme);
|
|
||||||
}
|
|
||||||
if (previous.cookieBannerHandlingMode !=
|
|
||||||
next.cookieBannerHandlingMode) {
|
|
||||||
await _service.cookieBannerHandlingMode(
|
|
||||||
next.cookieBannerHandlingMode,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (previous.cookieBannerHandlingModePrivateBrowsing !=
|
|
||||||
next.cookieBannerHandlingModePrivateBrowsing) {
|
|
||||||
await _service.cookieBannerHandlingModePrivateBrowsing(
|
|
||||||
next.cookieBannerHandlingModePrivateBrowsing,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (previous.cookieBannerHandlingGlobalRules !=
|
|
||||||
next.cookieBannerHandlingGlobalRules) {
|
|
||||||
await _service.cookieBannerHandlingGlobalRules(
|
|
||||||
next.cookieBannerHandlingGlobalRules,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (previous.cookieBannerHandlingGlobalRulesSubFrames !=
|
|
||||||
next.cookieBannerHandlingGlobalRulesSubFrames) {
|
|
||||||
await _service.cookieBannerHandlingGlobalRulesSubFrames(
|
|
||||||
next.cookieBannerHandlingGlobalRulesSubFrames,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (previous.webContentIsolationStrategy !=
|
|
||||||
next.webContentIsolationStrategy) {
|
|
||||||
await _service.webContentIsolationStrategy(
|
|
||||||
next.webContentIsolationStrategy,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
await _service.setDefaultSettings(next);
|
|
||||||
initialSettingsSent = true;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error, stackTrace) {
|
onError: (error, stackTrace) {
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ part of 'engine_settings_replication.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$engineSettingsReplicationServiceHash() =>
|
String _$engineSettingsReplicationServiceHash() =>
|
||||||
r'31b5b79e429bfedb9c6b57050cd2d99407914228';
|
r'be3001c952dac6c7c6be3927f6834dae57280601';
|
||||||
|
|
||||||
/// See also [EngineSettingsReplicationService].
|
/// See also [EngineSettingsReplicationService].
|
||||||
@ProviderFor(EngineSettingsReplicationService)
|
@ProviderFor(EngineSettingsReplicationService)
|
||||||
|
|||||||
+1
-1
@@ -84,7 +84,7 @@ class ProxySettingsReplication extends _$ProxySettingsReplication {
|
|||||||
|
|
||||||
ref.listen(
|
ref.listen(
|
||||||
fireImmediately: true,
|
fireImmediately: true,
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.proxyPrivateTabsTor,
|
(value) => value.proxyPrivateTabsTor,
|
||||||
),
|
),
|
||||||
(previous, next) async {
|
(previous, next) async {
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ part of 'proxy_settings_replication.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$proxySettingsReplicationHash() =>
|
String _$proxySettingsReplicationHash() =>
|
||||||
r'4476bab659f09de0866d0b3ae10d54ccb996335d';
|
r'e9f3adc73349c6d33fc7009412984b1daa4cc8da';
|
||||||
|
|
||||||
/// See also [ProxySettingsReplication].
|
/// See also [ProxySettingsReplication].
|
||||||
@ProviderFor(ProxySettingsReplication)
|
@ProviderFor(ProxySettingsReplication)
|
||||||
|
|||||||
+3
-3
@@ -65,7 +65,7 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final showExtensionShortcut = ref.watch(
|
final showExtensionShortcut = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.showExtensionShortcut,
|
(value) => value.showExtensionShortcut,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -209,7 +209,7 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultCreateTabType ==
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultCreateTabType ==
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
|
|||||||
+9
-8
@@ -85,13 +85,14 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
useOnInitialization(() async {
|
useOnInitialization(() async {
|
||||||
await ref.read(generalSettingsRepositoryProvider.notifier).fetch().then((
|
await ref
|
||||||
settings,
|
.read(generalSettingsRepositoryProvider.notifier)
|
||||||
) async {
|
.fetchSettings()
|
||||||
await ref
|
.then((settings) async {
|
||||||
.read(browserDataServiceProvider.notifier)
|
await ref
|
||||||
.deleteDataOnEngineStart(settings.deleteBrowsingDataOnQuit);
|
.read(browserDataServiceProvider.notifier)
|
||||||
});
|
.deleteDataOnEngineStart(settings.deleteBrowsingDataOnQuit);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
final hasTab = ref.watch(
|
final hasTab = ref.watch(
|
||||||
@@ -313,7 +314,7 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
|||||||
widget.suggestionTimeout) {
|
widget.suggestionTimeout) {
|
||||||
//Don't do anything if a child route is active
|
//Don't do anything if a child route is active
|
||||||
if (GoRouterState.of(context).topRoute?.name == BrowserRoute.name) {
|
if (GoRouterState.of(context).topRoute?.name == BrowserRoute.name) {
|
||||||
final settings = ref.read(generalSettingsRepositoryProvider);
|
final settings = ref.read(generalSettingsWithDefaultsProvider);
|
||||||
|
|
||||||
unawaited(
|
unawaited(
|
||||||
showSuggestNewTabMessage(
|
showSuggestNewTabMessage(
|
||||||
|
|||||||
+4
-4
@@ -129,7 +129,7 @@ class _TabSheetHeader extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final enableAiFeatures = ref.watch(
|
final enableAiFeatures = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(settings) => settings.enableLocalAiFeatures,
|
(settings) => settings.enableLocalAiFeatures,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -415,7 +415,7 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
tabSuggestionsControllerProvider,
|
tabSuggestionsControllerProvider,
|
||||||
);
|
);
|
||||||
final enableAiFeatures = ref.watch(
|
final enableAiFeatures = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(settings) => settings.enableLocalAiFeatures,
|
(settings) => settings.enableLocalAiFeatures,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -605,7 +605,7 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
child: FloatingActionButton.small(
|
child: FloatingActionButton.small(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final settings = ref.read(generalSettingsRepositoryProvider);
|
final settings = ref.read(generalSettingsWithDefaultsProvider);
|
||||||
|
|
||||||
await SearchRoute(
|
await SearchRoute(
|
||||||
tabType:
|
tabType:
|
||||||
@@ -786,7 +786,7 @@ class ViewTabTreesSheetWidget extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
child: FloatingActionButton.small(
|
child: FloatingActionButton.small(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final settings = ref.read(generalSettingsRepositoryProvider);
|
final settings = ref.read(generalSettingsWithDefaultsProvider);
|
||||||
|
|
||||||
await SearchRoute(
|
await SearchRoute(
|
||||||
tabType:
|
tabType:
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ class TabCreationMenu extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final createChildTabsOption = ref.watch(
|
final createChildTabsOption = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.createChildTabsOption,
|
(value) => value.createChildTabsOption,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
+3
-1
@@ -47,7 +47,9 @@ class OpenImageInNewTab extends HookConsumerWidget {
|
|||||||
final currentTab = ref.read(selectedTabStateProvider);
|
final currentTab = ref.read(selectedTabStateProvider);
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
currentTab?.isPrivate ??
|
currentTab?.isPrivate ??
|
||||||
ref.read(generalSettingsRepositoryProvider).defaultCreateTabType ==
|
ref
|
||||||
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
final tabId = await ref
|
final tabId = await ref
|
||||||
|
|||||||
+3
-1
@@ -47,7 +47,9 @@ class OpenInNewTab extends HookConsumerWidget {
|
|||||||
final currentTab = ref.read(selectedTabStateProvider);
|
final currentTab = ref.read(selectedTabStateProvider);
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
currentTab?.isPrivate ??
|
currentTab?.isPrivate ??
|
||||||
ref.read(generalSettingsRepositoryProvider).defaultCreateTabType ==
|
ref
|
||||||
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
final tabId = await ref
|
final tabId = await ref
|
||||||
|
|||||||
+2
-2
@@ -34,13 +34,13 @@ class ReaderButton extends HookConsumerWidget {
|
|||||||
final readerChanging = ref.watch(readerableScreenControllerProvider);
|
final readerChanging = ref.watch(readerableScreenControllerProvider);
|
||||||
|
|
||||||
final enableReadability = ref.watch(
|
final enableReadability = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.enableReadability,
|
(value) => value.enableReadability,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final enforceReadability = ref.watch(
|
final enforceReadability = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.enforceReadability,
|
(value) => value.enforceReadability,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ part 'search_suggestions.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
ISearchSuggestionProvider defaultSearchSuggestions(Ref ref) {
|
ISearchSuggestionProvider defaultSearchSuggestions(Ref ref) {
|
||||||
final provider = ref.watch(
|
final provider = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.defaultSearchSuggestionsProvider,
|
(value) => value.defaultSearchSuggestionsProvider,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ part of 'search_suggestions.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$defaultSearchSuggestionsHash() =>
|
String _$defaultSearchSuggestionsHash() =>
|
||||||
r'eb96a5db465422558a26e22abb3f843a82c17452';
|
r'6d7a387c7daeb790a4c9a5cdc105d2a2bdbacd2b';
|
||||||
|
|
||||||
/// See also [defaultSearchSuggestions].
|
/// See also [defaultSearchSuggestions].
|
||||||
@ProviderFor(defaultSearchSuggestions)
|
@ProviderFor(defaultSearchSuggestions)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class SearchScreen extends HookConsumerWidget {
|
|||||||
final formKey = useMemoized(() => GlobalKey<FormState>());
|
final formKey = useMemoized(() => GlobalKey<FormState>());
|
||||||
|
|
||||||
final createChildTabsOption = ref.watch(
|
final createChildTabsOption = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.createChildTabsOption,
|
(value) => value.createChildTabsOption,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class GeckoInferenceRepository extends _$GeckoInferenceRepository {
|
|||||||
|
|
||||||
Future<String?> predictDocumentTopic(Set<String> titles) async {
|
Future<String?> predictDocumentTopic(Set<String> titles) async {
|
||||||
if (!ref.read(
|
if (!ref.read(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(settings) => settings.enableLocalAiFeatures,
|
(settings) => settings.enableLocalAiFeatures,
|
||||||
),
|
),
|
||||||
)) {
|
)) {
|
||||||
@@ -97,7 +97,7 @@ class GeckoInferenceRepository extends _$GeckoInferenceRepository {
|
|||||||
required List<String> unassignedDocumentsInput,
|
required List<String> unassignedDocumentsInput,
|
||||||
}) async {
|
}) async {
|
||||||
if (!ref.read(
|
if (!ref.read(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(settings) => settings.enableLocalAiFeatures,
|
(settings) => settings.enableLocalAiFeatures,
|
||||||
),
|
),
|
||||||
)) {
|
)) {
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ class _ContainerTabSuggestionsProviderElement
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _$geckoInferenceRepositoryHash() =>
|
String _$geckoInferenceRepositoryHash() =>
|
||||||
r'170bd0b67e5f1edc43ed97d4535f41353fb8796e';
|
r'6099998a3f49fc4faf650878ab4afd6268c593e2';
|
||||||
|
|
||||||
/// See also [GeckoInferenceRepository].
|
/// See also [GeckoInferenceRepository].
|
||||||
@ProviderFor(GeckoInferenceRepository)
|
@ProviderFor(GeckoInferenceRepository)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class AiConfigurationPage extends HookConsumerWidget {
|
|||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
|
||||||
final enableLocalAiFeatures = ref.watch(
|
final enableLocalAiFeatures = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(settings) => settings.enableLocalAiFeatures,
|
(settings) => settings.enableLocalAiFeatures,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class DefaultSearchPage extends HookConsumerWidget {
|
|||||||
defaultSearchBangDataProvider.select((value) => value.valueOrNull),
|
defaultSearchBangDataProvider.select((value) => value.valueOrNull),
|
||||||
);
|
);
|
||||||
final activeAutosuggest = ref.watch(
|
final activeAutosuggest = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.defaultSearchSuggestionsProvider,
|
(value) => value.defaultSearchSuggestionsProvider,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class DeveloperSettingsScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final engineSettings = ref.watch(engineSettingsRepositoryProvider);
|
final engineSettings = ref.watch(engineSettingsWithDefaultsProvider);
|
||||||
|
|
||||||
final userAgentTextController = useTextEditingController(
|
final userAgentTextController = useTextEditingController(
|
||||||
text: engineSettings.userAgent,
|
text: engineSettings.userAgent,
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class GeneralSettingsScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final generalSettings = ref.watch(generalSettingsRepositoryProvider);
|
final generalSettings = ref.watch(generalSettingsWithDefaultsProvider);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: const Text('General Settings')),
|
appBar: AppBar(title: const Text('General Settings')),
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ class WebEngineSettingsScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final generalSettings = ref.watch(generalSettingsRepositoryProvider);
|
final generalSettings = ref.watch(generalSettingsWithDefaultsProvider);
|
||||||
final engineSettings = ref.watch(engineSettingsRepositoryProvider);
|
final engineSettings = ref.watch(engineSettingsWithDefaultsProvider);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: const Text('Web Engine Settings')),
|
appBar: AppBar(title: const Text('Web Engine Settings')),
|
||||||
@@ -115,7 +115,7 @@ class WebEngineSettingsScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SwitchListTile.adaptive(
|
SwitchListTile.adaptive(
|
||||||
title: const Text('Enable Global Privacy Control (GPC)'),
|
title: const Text('Global Privacy Control (GPC)'),
|
||||||
secondary: const Icon(MdiIcons.incognitoCircleOff),
|
secondary: const Icon(MdiIcons.incognitoCircleOff),
|
||||||
value: engineSettings.globalPrivacyControlEnabled,
|
value: engineSettings.globalPrivacyControlEnabled,
|
||||||
onChanged: (value) async {
|
onChanged: (value) async {
|
||||||
@@ -300,6 +300,76 @@ class WebEngineSettingsScreen extends HookConsumerWidget {
|
|||||||
// ],
|
// ],
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
|
SwitchListTile.adaptive(
|
||||||
|
title: const Text('Bounce Tracking Protection'),
|
||||||
|
secondary: const Icon(MdiIcons.securityNetwork),
|
||||||
|
value: switch (engineSettings
|
||||||
|
.contentBlocking
|
||||||
|
.bounceTrackingProtectionMode) {
|
||||||
|
BounceTrackingProtectionMode.disabled => false,
|
||||||
|
BounceTrackingProtectionMode.enabled => true,
|
||||||
|
BounceTrackingProtectionMode.enabledStandby => false,
|
||||||
|
BounceTrackingProtectionMode.enabledDryRun => false,
|
||||||
|
},
|
||||||
|
onChanged: (value) async {
|
||||||
|
await ref
|
||||||
|
.read(saveEngineSettingsControllerProvider.notifier)
|
||||||
|
.save(
|
||||||
|
(currentSettings) => currentSettings.copyWith
|
||||||
|
.bounceTrackingProtectionMode(
|
||||||
|
value
|
||||||
|
? BounceTrackingProtectionMode.enabled
|
||||||
|
: BounceTrackingProtectionMode.disabled,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 8,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const ListTile(
|
||||||
|
title: Text('Query Parameter Stripping'),
|
||||||
|
leading: Icon(MdiIcons.closeNetwork),
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: SegmentedButton<QueryParameterStripping>(
|
||||||
|
segments: const [
|
||||||
|
ButtonSegment(
|
||||||
|
value: QueryParameterStripping.disabled,
|
||||||
|
label: Text('Disabled'),
|
||||||
|
),
|
||||||
|
ButtonSegment(
|
||||||
|
value: QueryParameterStripping.enabled,
|
||||||
|
label: Text('Enabled'),
|
||||||
|
),
|
||||||
|
ButtonSegment(
|
||||||
|
value: QueryParameterStripping.privateOnly,
|
||||||
|
label: Text('Private mode only'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
selected: {engineSettings.queryParameterStripping},
|
||||||
|
onSelectionChanged: (value) async {
|
||||||
|
await ref
|
||||||
|
.read(
|
||||||
|
saveEngineSettingsControllerProvider.notifier,
|
||||||
|
)
|
||||||
|
.save(
|
||||||
|
(currentSettings) => currentSettings.copyWith
|
||||||
|
.queryParameterStripping(value.first),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text('Web Engine Hardening'),
|
title: const Text('Web Engine Hardening'),
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class TorProxyScreen extends HookConsumerWidget {
|
|||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final torProxyPort = ref.watch(torProxyServiceProvider);
|
final torProxyPort = ref.watch(torProxyServiceProvider);
|
||||||
final proxyPrivateTabsTor = ref.watch(
|
final proxyPrivateTabsTor = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.proxyPrivateTabsTor,
|
(value) => value.proxyPrivateTabsTor,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -54,6 +54,20 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
|||||||
WebContentIsolationStrategy get webContentIsolationStrategy =>
|
WebContentIsolationStrategy get webContentIsolationStrategy =>
|
||||||
super.webContentIsolationStrategy!;
|
super.webContentIsolationStrategy!;
|
||||||
|
|
||||||
|
final QueryParameterStripping queryParameterStripping;
|
||||||
|
|
||||||
|
final BounceTrackingProtectionMode bounceTrackingProtectionMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
ContentBlocking get contentBlocking => ContentBlocking(
|
||||||
|
queryParameterStripping: queryParameterStripping,
|
||||||
|
queryParameterStrippingAllowList: '',
|
||||||
|
queryParameterStrippingStripList:
|
||||||
|
'__hsfp __hssc __hstc __s _bhlid _branch_match_id _branch_referrer _gl _hsenc _kx _openstat at_recipient_id at_recipient_list bbeml bsft_clkid bsft_uid dclid et_rid fb_action_ids fb_comment_id fbclid gbraid gclid guce_referrer guce_referrer_sig hsCtaTracking igshid irclickid mc_eid mkt_tok ml_subscriber ml_subscriber_hash msclkid mtm_cid oft_c oft_ck oft_d oft_id oft_ids oft_k oft_lk oft_sk oly_anon_id oly_enc_id pk_cid rb_clickid s_cid sc_customer sc_eh sc_uid srsltid ss_email_id twclid unicorn_click_id vero_conv vero_id vgo_ee wbraid wickedid yclid ymclid ysclid',
|
||||||
|
bounceTrackingProtectionMode: bounceTrackingProtectionMode,
|
||||||
|
);
|
||||||
|
|
||||||
EngineSettings({
|
EngineSettings({
|
||||||
required super.javascriptEnabled,
|
required super.javascriptEnabled,
|
||||||
required super.trackingProtectionPolicy,
|
required super.trackingProtectionPolicy,
|
||||||
@@ -66,6 +80,8 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
|||||||
required super.cookieBannerHandlingGlobalRulesSubFrames,
|
required super.cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
required super.webContentIsolationStrategy,
|
required super.webContentIsolationStrategy,
|
||||||
required super.userAgent,
|
required super.userAgent,
|
||||||
|
required this.queryParameterStripping,
|
||||||
|
required this.bounceTrackingProtectionMode,
|
||||||
});
|
});
|
||||||
|
|
||||||
EngineSettings.withDefaults({
|
EngineSettings.withDefaults({
|
||||||
@@ -79,8 +95,15 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
|||||||
bool? cookieBannerHandlingGlobalRules,
|
bool? cookieBannerHandlingGlobalRules,
|
||||||
bool? cookieBannerHandlingGlobalRulesSubFrames,
|
bool? cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
WebContentIsolationStrategy? webContentIsolationStrategy,
|
WebContentIsolationStrategy? webContentIsolationStrategy,
|
||||||
|
QueryParameterStripping? queryParameterStripping,
|
||||||
|
BounceTrackingProtectionMode? bounceTrackingProtectionMode,
|
||||||
super.userAgent,
|
super.userAgent,
|
||||||
}) : super(
|
}) : queryParameterStripping =
|
||||||
|
queryParameterStripping ?? QueryParameterStripping.disabled,
|
||||||
|
bounceTrackingProtectionMode =
|
||||||
|
bounceTrackingProtectionMode ??
|
||||||
|
BounceTrackingProtectionMode.disabled,
|
||||||
|
super(
|
||||||
javascriptEnabled: javascriptEnabled ?? true,
|
javascriptEnabled: javascriptEnabled ?? true,
|
||||||
trackingProtectionPolicy:
|
trackingProtectionPolicy:
|
||||||
trackingProtectionPolicy ?? TrackingProtectionPolicy.strict,
|
trackingProtectionPolicy ?? TrackingProtectionPolicy.strict,
|
||||||
@@ -119,5 +142,7 @@ class EngineSettings extends GeckoEngineSettings with FastEquatable {
|
|||||||
super.cookieBannerHandlingGlobalRulesSubFrames,
|
super.cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
super.webContentIsolationStrategy,
|
super.webContentIsolationStrategy,
|
||||||
super.userAgent,
|
super.userAgent,
|
||||||
|
queryParameterStripping,
|
||||||
|
bounceTrackingProtectionMode,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,14 @@ abstract class _$EngineSettingsCWProxy {
|
|||||||
|
|
||||||
EngineSettings userAgent(String? userAgent);
|
EngineSettings userAgent(String? userAgent);
|
||||||
|
|
||||||
|
EngineSettings queryParameterStripping(
|
||||||
|
QueryParameterStripping queryParameterStripping,
|
||||||
|
);
|
||||||
|
|
||||||
|
EngineSettings bounceTrackingProtectionMode(
|
||||||
|
BounceTrackingProtectionMode bounceTrackingProtectionMode,
|
||||||
|
);
|
||||||
|
|
||||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EngineSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EngineSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
///
|
///
|
||||||
/// Usage
|
/// Usage
|
||||||
@@ -59,6 +67,8 @@ abstract class _$EngineSettingsCWProxy {
|
|||||||
bool? cookieBannerHandlingGlobalRulesSubFrames,
|
bool? cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
WebContentIsolationStrategy? webContentIsolationStrategy,
|
WebContentIsolationStrategy? webContentIsolationStrategy,
|
||||||
String? userAgent,
|
String? userAgent,
|
||||||
|
QueryParameterStripping queryParameterStripping,
|
||||||
|
BounceTrackingProtectionMode bounceTrackingProtectionMode,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,6 +134,16 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
|||||||
@override
|
@override
|
||||||
EngineSettings userAgent(String? userAgent) => this(userAgent: userAgent);
|
EngineSettings userAgent(String? userAgent) => this(userAgent: userAgent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
EngineSettings queryParameterStripping(
|
||||||
|
QueryParameterStripping queryParameterStripping,
|
||||||
|
) => this(queryParameterStripping: queryParameterStripping);
|
||||||
|
|
||||||
|
@override
|
||||||
|
EngineSettings bounceTrackingProtectionMode(
|
||||||
|
BounceTrackingProtectionMode bounceTrackingProtectionMode,
|
||||||
|
) => this(bounceTrackingProtectionMode: bounceTrackingProtectionMode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EngineSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EngineSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
///
|
///
|
||||||
@@ -145,6 +165,8 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
|||||||
const $CopyWithPlaceholder(),
|
const $CopyWithPlaceholder(),
|
||||||
Object? webContentIsolationStrategy = const $CopyWithPlaceholder(),
|
Object? webContentIsolationStrategy = const $CopyWithPlaceholder(),
|
||||||
Object? userAgent = const $CopyWithPlaceholder(),
|
Object? userAgent = const $CopyWithPlaceholder(),
|
||||||
|
Object? queryParameterStripping = const $CopyWithPlaceholder(),
|
||||||
|
Object? bounceTrackingProtectionMode = const $CopyWithPlaceholder(),
|
||||||
}) {
|
}) {
|
||||||
return EngineSettings(
|
return EngineSettings(
|
||||||
javascriptEnabled: javascriptEnabled == const $CopyWithPlaceholder()
|
javascriptEnabled: javascriptEnabled == const $CopyWithPlaceholder()
|
||||||
@@ -201,6 +223,16 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
|
|||||||
? _value.userAgent
|
? _value.userAgent
|
||||||
// ignore: cast_nullable_to_non_nullable
|
// ignore: cast_nullable_to_non_nullable
|
||||||
: userAgent as String?,
|
: userAgent as String?,
|
||||||
|
queryParameterStripping:
|
||||||
|
queryParameterStripping == const $CopyWithPlaceholder()
|
||||||
|
? _value.queryParameterStripping
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: queryParameterStripping as QueryParameterStripping,
|
||||||
|
bounceTrackingProtectionMode:
|
||||||
|
bounceTrackingProtectionMode == const $CopyWithPlaceholder()
|
||||||
|
? _value.bounceTrackingProtectionMode
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: bounceTrackingProtectionMode as BounceTrackingProtectionMode,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,6 +279,14 @@ EngineSettings _$EngineSettingsFromJson(Map<String, dynamic> json) =>
|
|||||||
_$WebContentIsolationStrategyEnumMap,
|
_$WebContentIsolationStrategyEnumMap,
|
||||||
json['webContentIsolationStrategy'],
|
json['webContentIsolationStrategy'],
|
||||||
),
|
),
|
||||||
|
queryParameterStripping: $enumDecodeNullable(
|
||||||
|
_$QueryParameterStrippingEnumMap,
|
||||||
|
json['queryParameterStripping'],
|
||||||
|
),
|
||||||
|
bounceTrackingProtectionMode: $enumDecodeNullable(
|
||||||
|
_$BounceTrackingProtectionModeEnumMap,
|
||||||
|
json['bounceTrackingProtectionMode'],
|
||||||
|
),
|
||||||
userAgent: json['userAgent'] as String?,
|
userAgent: json['userAgent'] as String?,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -271,6 +311,11 @@ Map<String, dynamic> _$EngineSettingsToJson(
|
|||||||
'webContentIsolationStrategy':
|
'webContentIsolationStrategy':
|
||||||
_$WebContentIsolationStrategyEnumMap[instance
|
_$WebContentIsolationStrategyEnumMap[instance
|
||||||
.webContentIsolationStrategy]!,
|
.webContentIsolationStrategy]!,
|
||||||
|
'queryParameterStripping':
|
||||||
|
_$QueryParameterStrippingEnumMap[instance.queryParameterStripping]!,
|
||||||
|
'bounceTrackingProtectionMode':
|
||||||
|
_$BounceTrackingProtectionModeEnumMap[instance
|
||||||
|
.bounceTrackingProtectionMode]!,
|
||||||
};
|
};
|
||||||
|
|
||||||
const _$TrackingProtectionPolicyEnumMap = {
|
const _$TrackingProtectionPolicyEnumMap = {
|
||||||
@@ -303,3 +348,16 @@ const _$WebContentIsolationStrategyEnumMap = {
|
|||||||
WebContentIsolationStrategy.isolateEverything: 'isolateEverything',
|
WebContentIsolationStrategy.isolateEverything: 'isolateEverything',
|
||||||
WebContentIsolationStrategy.isolateHighValue: 'isolateHighValue',
|
WebContentIsolationStrategy.isolateHighValue: 'isolateHighValue',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const _$QueryParameterStrippingEnumMap = {
|
||||||
|
QueryParameterStripping.disabled: 'disabled',
|
||||||
|
QueryParameterStripping.privateOnly: 'privateOnly',
|
||||||
|
QueryParameterStripping.enabled: 'enabled',
|
||||||
|
};
|
||||||
|
|
||||||
|
const _$BounceTrackingProtectionModeEnumMap = {
|
||||||
|
BounceTrackingProtectionMode.disabled: 'disabled',
|
||||||
|
BounceTrackingProtectionMode.enabled: 'enabled',
|
||||||
|
BounceTrackingProtectionMode.enabledStandby: 'enabledStandby',
|
||||||
|
BounceTrackingProtectionMode.enabledDryRun: 'enabledDryRun',
|
||||||
|
};
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ Stream<double> iconCacheSizeMegabytes(Ref ref) {
|
|||||||
@Riverpod()
|
@Riverpod()
|
||||||
bool incognitoModeEnabled(Ref ref) {
|
bool incognitoModeEnabled(Ref ref) {
|
||||||
return ref.watch(
|
return ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.deleteBrowsingDataOnQuit != null,
|
(value) => value.deleteBrowsingDataOnQuit != null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ final iconCacheSizeMegabytesProvider =
|
|||||||
// ignore: unused_element
|
// ignore: unused_element
|
||||||
typedef IconCacheSizeMegabytesRef = AutoDisposeStreamProviderRef<double>;
|
typedef IconCacheSizeMegabytesRef = AutoDisposeStreamProviderRef<double>;
|
||||||
String _$incognitoModeEnabledHash() =>
|
String _$incognitoModeEnabledHash() =>
|
||||||
r'3968c2d4945be09a0bc08ce0d70b0390187c44e8';
|
r'36957b70a5261f9d3ad228e07cc8dd5c8f616082';
|
||||||
|
|
||||||
/// See also [incognitoModeEnabled].
|
/// See also [incognitoModeEnabled].
|
||||||
@ProviderFor(incognitoModeEnabled)
|
@ProviderFor(incognitoModeEnabled)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:drift/drift.dart';
|
import 'package:drift/drift.dart';
|
||||||
|
import 'package:riverpod/riverpod.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:weblibre/features/user/data/models/engine_settings.dart';
|
import 'package:weblibre/features/user/data/models/engine_settings.dart';
|
||||||
import 'package:weblibre/features/user/data/providers.dart';
|
import 'package:weblibre/features/user/data/providers.dart';
|
||||||
@@ -33,9 +34,72 @@ typedef UpdateEngineSettingsFunc =
|
|||||||
class EngineSettingsRepository extends _$EngineSettingsRepository {
|
class EngineSettingsRepository extends _$EngineSettingsRepository {
|
||||||
final _partitionKey = 'engine';
|
final _partitionKey = 'engine';
|
||||||
|
|
||||||
Future<void> updateSettings(UpdateEngineSettingsFunc updateWithCurrent) {
|
EngineSettings _deserializeSettings(
|
||||||
final oldJson = state.toJson();
|
List<MapEntry<String, DriftAny?>> entries,
|
||||||
final newJson = updateWithCurrent(state).toJson();
|
) {
|
||||||
|
final db = ref.read(userDatabaseProvider);
|
||||||
|
final settings = Map.fromEntries(entries);
|
||||||
|
|
||||||
|
return EngineSettings.fromJson({
|
||||||
|
'incognitoMode': settings['incognitoMode']?.readAs(
|
||||||
|
DriftSqlType.bool,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'javascriptEnabled': settings['javascriptEnabled']?.readAs(
|
||||||
|
DriftSqlType.bool,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'trackingProtectionPolicy': settings['trackingProtectionPolicy']?.readAs(
|
||||||
|
DriftSqlType.string,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'httpsOnlyMode': settings['httpsOnlyMode']?.readAs(
|
||||||
|
DriftSqlType.string,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'globalPrivacyControlEnabled': settings['globalPrivacyControlEnabled']
|
||||||
|
?.readAs(DriftSqlType.bool, db.typeMapping),
|
||||||
|
'cookieBannerHandlingMode': settings['cookieBannerHandlingMode']?.readAs(
|
||||||
|
DriftSqlType.string,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'cookieBannerHandlingModePrivateBrowsing':
|
||||||
|
settings['cookieBannerHandlingModePrivateBrowsing']?.readAs(
|
||||||
|
DriftSqlType.string,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'cookieBannerHandlingGlobalRules':
|
||||||
|
settings['cookieBannerHandlingGlobalRules']?.readAs(
|
||||||
|
DriftSqlType.bool,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'cookieBannerHandlingGlobalRulesSubFrames':
|
||||||
|
settings['cookieBannerHandlingGlobalRulesSubFrames']?.readAs(
|
||||||
|
DriftSqlType.bool,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'webContentIsolationStrategy': settings['webContentIsolationStrategy']
|
||||||
|
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||||
|
'userAgent': settings['userAgent']?.readAs(
|
||||||
|
DriftSqlType.string,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'queryParameterStripping': settings['queryParameterStripping']?.readAs(
|
||||||
|
DriftSqlType.string,
|
||||||
|
db.typeMapping,
|
||||||
|
),
|
||||||
|
'bounceTrackingProtectionMode': settings['bounceTrackingProtectionMode']
|
||||||
|
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> updateSettings(
|
||||||
|
UpdateEngineSettingsFunc updateWithCurrent,
|
||||||
|
) async {
|
||||||
|
final current = await fetchSettings();
|
||||||
|
|
||||||
|
final oldJson = current.toJson();
|
||||||
|
final newJson = updateWithCurrent(current).toJson();
|
||||||
|
|
||||||
return ref.read(userDatabaseProvider).transaction(() async {
|
return ref.read(userDatabaseProvider).transaction(() async {
|
||||||
for (final MapEntry(:key, :value) in newJson.entries) {
|
for (final MapEntry(:key, :value) in newJson.entries) {
|
||||||
@@ -49,69 +113,33 @@ class EngineSettingsRepository extends _$EngineSettingsRepository {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<EngineSettings> fetchSettings() {
|
||||||
|
return ref
|
||||||
|
.read(userDatabaseProvider)
|
||||||
|
.settingDao
|
||||||
|
.getAllSettingsOfPartitionKey(_partitionKey)
|
||||||
|
.get()
|
||||||
|
.then(_deserializeSettings);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
EngineSettings build() {
|
Stream<EngineSettings> build() {
|
||||||
final db = ref.watch(userDatabaseProvider);
|
final db = ref.watch(userDatabaseProvider);
|
||||||
|
|
||||||
final watchSub = db.settingDao
|
return db.settingDao
|
||||||
.getAllSettingsOfPartitionKey(_partitionKey)
|
.getAllSettingsOfPartitionKey(_partitionKey)
|
||||||
.watch()
|
.watch()
|
||||||
.listen((entries) {
|
.map((entries) {
|
||||||
final settings = Map.fromEntries(entries);
|
return _deserializeSettings(entries);
|
||||||
|
|
||||||
state = EngineSettings.fromJson({
|
|
||||||
'incognitoMode': settings['incognitoMode']?.readAs(
|
|
||||||
DriftSqlType.bool,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'javascriptEnabled': settings['javascriptEnabled']?.readAs(
|
|
||||||
DriftSqlType.bool,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'trackingProtectionPolicy': settings['trackingProtectionPolicy']
|
|
||||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
|
||||||
'httpsOnlyMode': settings['httpsOnlyMode']?.readAs(
|
|
||||||
DriftSqlType.string,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'globalPrivacyControlEnabled':
|
|
||||||
settings['globalPrivacyControlEnabled']?.readAs(
|
|
||||||
DriftSqlType.bool,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'cookieBannerHandlingMode': settings['cookieBannerHandlingMode']
|
|
||||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
|
||||||
'cookieBannerHandlingModePrivateBrowsing':
|
|
||||||
settings['cookieBannerHandlingModePrivateBrowsing']?.readAs(
|
|
||||||
DriftSqlType.string,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'cookieBannerHandlingGlobalRules':
|
|
||||||
settings['cookieBannerHandlingGlobalRules']?.readAs(
|
|
||||||
DriftSqlType.bool,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'cookieBannerHandlingGlobalRulesSubFrames':
|
|
||||||
settings['cookieBannerHandlingGlobalRulesSubFrames']?.readAs(
|
|
||||||
DriftSqlType.bool,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'webContentIsolationStrategy':
|
|
||||||
settings['webContentIsolationStrategy']?.readAs(
|
|
||||||
DriftSqlType.string,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
'userAgent': settings['userAgent']?.readAs(
|
|
||||||
DriftSqlType.string,
|
|
||||||
db.typeMapping,
|
|
||||||
),
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ref.onDispose(() async {
|
|
||||||
await watchSub.cancel();
|
|
||||||
});
|
|
||||||
|
|
||||||
return EngineSettings.withDefaults();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Riverpod()
|
||||||
|
EngineSettings engineSettingsWithDefaults(Ref ref) {
|
||||||
|
return ref.watch(
|
||||||
|
engineSettingsRepositoryProvider.select(
|
||||||
|
(value) => value.valueOrNull ?? EngineSettings.withDefaults(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,13 +6,32 @@ part of 'engine_settings.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
String _$engineSettingsWithDefaultsHash() =>
|
||||||
|
r'018e37f31f893e203b86038e84b0ddf5e72454d4';
|
||||||
|
|
||||||
|
/// See also [engineSettingsWithDefaults].
|
||||||
|
@ProviderFor(engineSettingsWithDefaults)
|
||||||
|
final engineSettingsWithDefaultsProvider =
|
||||||
|
AutoDisposeProvider<EngineSettings>.internal(
|
||||||
|
engineSettingsWithDefaults,
|
||||||
|
name: r'engineSettingsWithDefaultsProvider',
|
||||||
|
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||||
|
? null
|
||||||
|
: _$engineSettingsWithDefaultsHash,
|
||||||
|
dependencies: null,
|
||||||
|
allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||||
|
// ignore: unused_element
|
||||||
|
typedef EngineSettingsWithDefaultsRef = AutoDisposeProviderRef<EngineSettings>;
|
||||||
String _$engineSettingsRepositoryHash() =>
|
String _$engineSettingsRepositoryHash() =>
|
||||||
r'87e308c8bd4390d1d5c401532a0c35cd96f6176e';
|
r'aa522c35377280c451f6ac9e5f7063eab7ba6efc';
|
||||||
|
|
||||||
/// See also [EngineSettingsRepository].
|
/// See also [EngineSettingsRepository].
|
||||||
@ProviderFor(EngineSettingsRepository)
|
@ProviderFor(EngineSettingsRepository)
|
||||||
final engineSettingsRepositoryProvider =
|
final engineSettingsRepositoryProvider =
|
||||||
NotifierProvider<EngineSettingsRepository, EngineSettings>.internal(
|
StreamNotifierProvider<EngineSettingsRepository, EngineSettings>.internal(
|
||||||
EngineSettingsRepository.new,
|
EngineSettingsRepository.new,
|
||||||
name: r'engineSettingsRepositoryProvider',
|
name: r'engineSettingsRepositoryProvider',
|
||||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||||
@@ -22,6 +41,6 @@ final engineSettingsRepositoryProvider =
|
|||||||
allTransitiveDependencies: null,
|
allTransitiveDependencies: null,
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef _$EngineSettingsRepository = Notifier<EngineSettings>;
|
typedef _$EngineSettingsRepository = StreamNotifier<EngineSettings>;
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:drift/drift.dart';
|
import 'package:drift/drift.dart';
|
||||||
import 'package:nullability/nullability.dart';
|
import 'package:nullability/nullability.dart';
|
||||||
|
import 'package:riverpod/riverpod.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:weblibre/features/user/data/models/general_settings.dart';
|
import 'package:weblibre/features/user/data/models/general_settings.dart';
|
||||||
import 'package:weblibre/features/user/data/providers.dart';
|
import 'package:weblibre/features/user/data/providers.dart';
|
||||||
@@ -95,7 +96,7 @@ class GeneralSettingsRepository extends _$GeneralSettingsRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Eager fetch, when up to date settings are required
|
//Eager fetch, when up to date settings are required
|
||||||
Future<GeneralSettings> fetch() {
|
Future<GeneralSettings> fetchSettings() {
|
||||||
return ref
|
return ref
|
||||||
.read(userDatabaseProvider)
|
.read(userDatabaseProvider)
|
||||||
.settingDao
|
.settingDao
|
||||||
@@ -104,9 +105,13 @@ class GeneralSettingsRepository extends _$GeneralSettingsRepository {
|
|||||||
.then(_deserializeSettings);
|
.then(_deserializeSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateSettings(UpdateGeneralSettingsFunc updateWithCurrent) {
|
Future<void> updateSettings(
|
||||||
final oldJson = state.toJson();
|
UpdateGeneralSettingsFunc updateWithCurrent,
|
||||||
final newJson = updateWithCurrent(state).toJson();
|
) async {
|
||||||
|
final current = await fetchSettings();
|
||||||
|
|
||||||
|
final oldJson = current.toJson();
|
||||||
|
final newJson = updateWithCurrent(current).toJson();
|
||||||
|
|
||||||
final db = ref.read(userDatabaseProvider);
|
final db = ref.read(userDatabaseProvider);
|
||||||
|
|
||||||
@@ -120,20 +125,23 @@ class GeneralSettingsRepository extends _$GeneralSettingsRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
GeneralSettings build() {
|
Stream<GeneralSettings> build() {
|
||||||
final db = ref.watch(userDatabaseProvider);
|
final db = ref.watch(userDatabaseProvider);
|
||||||
|
|
||||||
final watchSub = db.settingDao
|
return db.settingDao
|
||||||
.getAllSettingsOfPartitionKey(_partitionKey)
|
.getAllSettingsOfPartitionKey(_partitionKey)
|
||||||
.watch()
|
.watch()
|
||||||
.listen((event) {
|
.map((event) {
|
||||||
state = _deserializeSettings(event);
|
return _deserializeSettings(event);
|
||||||
});
|
});
|
||||||
|
|
||||||
ref.onDispose(() async {
|
|
||||||
await watchSub.cancel();
|
|
||||||
});
|
|
||||||
|
|
||||||
return GeneralSettings.withDefaults();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Riverpod()
|
||||||
|
GeneralSettings generalSettingsWithDefaults(Ref ref) {
|
||||||
|
return ref.watch(
|
||||||
|
generalSettingsRepositoryProvider.select(
|
||||||
|
(value) => value.valueOrNull ?? GeneralSettings.withDefaults(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,13 +6,33 @@ part of 'general_settings.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
String _$generalSettingsWithDefaultsHash() =>
|
||||||
|
r'd2a20cb527f8bf5a16e273933cf7ccc9d0851dc4';
|
||||||
|
|
||||||
|
/// See also [generalSettingsWithDefaults].
|
||||||
|
@ProviderFor(generalSettingsWithDefaults)
|
||||||
|
final generalSettingsWithDefaultsProvider =
|
||||||
|
AutoDisposeProvider<GeneralSettings>.internal(
|
||||||
|
generalSettingsWithDefaults,
|
||||||
|
name: r'generalSettingsWithDefaultsProvider',
|
||||||
|
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||||
|
? null
|
||||||
|
: _$generalSettingsWithDefaultsHash,
|
||||||
|
dependencies: null,
|
||||||
|
allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||||
|
// ignore: unused_element
|
||||||
|
typedef GeneralSettingsWithDefaultsRef =
|
||||||
|
AutoDisposeProviderRef<GeneralSettings>;
|
||||||
String _$generalSettingsRepositoryHash() =>
|
String _$generalSettingsRepositoryHash() =>
|
||||||
r'538e03e9eff8beefc0918614c86d8919224c3039';
|
r'7e1c4d6051c4c3972b6998dee89d13b49be32e48';
|
||||||
|
|
||||||
/// See also [GeneralSettingsRepository].
|
/// See also [GeneralSettingsRepository].
|
||||||
@ProviderFor(GeneralSettingsRepository)
|
@ProviderFor(GeneralSettingsRepository)
|
||||||
final generalSettingsRepositoryProvider =
|
final generalSettingsRepositoryProvider =
|
||||||
NotifierProvider<GeneralSettingsRepository, GeneralSettings>.internal(
|
StreamNotifierProvider<GeneralSettingsRepository, GeneralSettings>.internal(
|
||||||
GeneralSettingsRepository.new,
|
GeneralSettingsRepository.new,
|
||||||
name: r'generalSettingsRepositoryProvider',
|
name: r'generalSettingsRepositoryProvider',
|
||||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||||
@@ -22,6 +42,6 @@ final generalSettingsRepositoryProvider =
|
|||||||
allTransitiveDependencies: null,
|
allTransitiveDependencies: null,
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef _$GeneralSettingsRepository = Notifier<GeneralSettings>;
|
typedef _$GeneralSettingsRepository = StreamNotifier<GeneralSettings>;
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class FeedArticleScreen extends HookConsumerWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultCreateTabType ==
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ class FeedArticleScreen extends HookConsumerWidget {
|
|||||||
case final Uri url) {
|
case final Uri url) {
|
||||||
final isPrivate =
|
final isPrivate =
|
||||||
ref
|
ref
|
||||||
.read(generalSettingsRepositoryProvider)
|
.read(generalSettingsWithDefaultsProvider)
|
||||||
.defaultCreateTabType ==
|
.defaultCreateTabType ==
|
||||||
TabType.private;
|
TabType.private;
|
||||||
|
|
||||||
|
|||||||
+11
-5
@@ -32,6 +32,7 @@ import 'package:weblibre/core/error_observer.dart';
|
|||||||
import 'package:weblibre/core/logger.dart';
|
import 'package:weblibre/core/logger.dart';
|
||||||
import 'package:weblibre/core/providers/defaults.dart';
|
import 'package:weblibre/core/providers/defaults.dart';
|
||||||
import 'package:weblibre/domain/services/app_initialization.dart';
|
import 'package:weblibre/domain/services/app_initialization.dart';
|
||||||
|
import 'package:weblibre/features/user/domain/repositories/engine_settings.dart';
|
||||||
import 'package:weblibre/features/user/domain/repositories/general_settings.dart';
|
import 'package:weblibre/features/user/domain/repositories/general_settings.dart';
|
||||||
import 'package:weblibre/features/web_feed/presentation/controllers/fetch_articles.dart';
|
import 'package:weblibre/features/web_feed/presentation/controllers/fetch_articles.dart';
|
||||||
import 'package:weblibre/features/web_feed/utils/fetch_entrypoint.dart';
|
import 'package:weblibre/features/web_feed/utils/fetch_entrypoint.dart';
|
||||||
@@ -69,10 +70,6 @@ void main() async {
|
|||||||
}, message);
|
}, message);
|
||||||
});
|
});
|
||||||
|
|
||||||
await GeckoBrowserService().initialize(
|
|
||||||
kDebugMode ? LogLevel.debug : LogLevel.warn,
|
|
||||||
);
|
|
||||||
|
|
||||||
await HomeWidget.setAppGroupId('weblibre');
|
await HomeWidget.setAppGroupId('weblibre');
|
||||||
|
|
||||||
runApp(
|
runApp(
|
||||||
@@ -81,12 +78,21 @@ void main() async {
|
|||||||
child: HookConsumer(
|
child: HookConsumer(
|
||||||
builder: (context, ref, child) {
|
builder: (context, ref, child) {
|
||||||
final themeMode = ref.watch(
|
final themeMode = ref.watch(
|
||||||
generalSettingsRepositoryProvider.select(
|
generalSettingsWithDefaultsProvider.select(
|
||||||
(value) => value.themeMode,
|
(value) => value.themeMode,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
useOnInitialization(() async {
|
useOnInitialization(() async {
|
||||||
|
final engineSettings = await ref
|
||||||
|
.read(engineSettingsRepositoryProvider.notifier)
|
||||||
|
.fetchSettings();
|
||||||
|
|
||||||
|
await GeckoBrowserService().initialize(
|
||||||
|
kDebugMode ? LogLevel.debug : LogLevel.warn,
|
||||||
|
engineSettings.contentBlocking,
|
||||||
|
);
|
||||||
|
|
||||||
await ref
|
await ref
|
||||||
.read(appInitializationServiceProvider.notifier)
|
.read(appInitializationServiceProvider.notifier)
|
||||||
.initialize();
|
.initialize();
|
||||||
|
|||||||
+2
@@ -15,6 +15,7 @@ import eu.weblibre.flutter_mozilla_components.components.Search
|
|||||||
import eu.weblibre.flutter_mozilla_components.components.Services
|
import eu.weblibre.flutter_mozilla_components.components.Services
|
||||||
import eu.weblibre.flutter_mozilla_components.components.UseCases
|
import eu.weblibre.flutter_mozilla_components.components.UseCases
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
||||||
|
import eu.weblibre.flutter_mozilla_components.pigeons.ContentBlocking
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonEvents
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoStateEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoStateEvents
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoSuggestionEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoSuggestionEvents
|
||||||
@@ -35,6 +36,7 @@ class Components(private val context: Context,
|
|||||||
val readerViewController: ReaderViewController,
|
val readerViewController: ReaderViewController,
|
||||||
val selectionAction: SelectionActionDelegate,
|
val selectionAction: SelectionActionDelegate,
|
||||||
val logLevel: Log.Priority,
|
val logLevel: Log.Priority,
|
||||||
|
val contentBlocking: ContentBlocking,
|
||||||
private val addonEvents: GeckoAddonEvents,
|
private val addonEvents: GeckoAddonEvents,
|
||||||
private val tabContentEvents: GeckoTabContentEvents,
|
private val tabContentEvents: GeckoTabContentEvents,
|
||||||
private val extensionEvents: BrowserExtensionEvents
|
private val extensionEvents: BrowserExtensionEvents
|
||||||
|
|||||||
+28
@@ -10,15 +10,19 @@ import eu.weblibre.flutter_mozilla_components.feature.CookieManagerFeature
|
|||||||
import eu.weblibre.flutter_mozilla_components.feature.PrefManagerFeature
|
import eu.weblibre.flutter_mozilla_components.feature.PrefManagerFeature
|
||||||
import eu.weblibre.flutter_mozilla_components.feature.BrowserExtensionFeature
|
import eu.weblibre.flutter_mozilla_components.feature.BrowserExtensionFeature
|
||||||
import eu.weblibre.flutter_mozilla_components.feature.MLEngineFeature
|
import eu.weblibre.flutter_mozilla_components.feature.MLEngineFeature
|
||||||
|
import eu.weblibre.flutter_mozilla_components.pigeons.BounceTrackingProtectionMode
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
||||||
|
import eu.weblibre.flutter_mozilla_components.pigeons.QueryParameterStripping
|
||||||
import mozilla.components.browser.engine.gecko.GeckoEngine
|
import mozilla.components.browser.engine.gecko.GeckoEngine
|
||||||
import mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClient
|
import mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClient
|
||||||
import mozilla.components.concept.engine.DefaultSettings
|
import mozilla.components.concept.engine.DefaultSettings
|
||||||
import mozilla.components.concept.engine.Engine
|
import mozilla.components.concept.engine.Engine
|
||||||
|
import mozilla.components.concept.engine.EngineSession
|
||||||
import mozilla.components.concept.fetch.Client
|
import mozilla.components.concept.fetch.Client
|
||||||
import mozilla.components.feature.webcompat.WebCompatFeature
|
import mozilla.components.feature.webcompat.WebCompatFeature
|
||||||
import mozilla.components.support.base.log.Log
|
import mozilla.components.support.base.log.Log
|
||||||
import mozilla.components.support.base.log.logger.Logger
|
import mozilla.components.support.base.log.logger.Logger
|
||||||
|
import org.mozilla.geckoview.ContentBlocking
|
||||||
import org.mozilla.geckoview.GeckoRuntime
|
import org.mozilla.geckoview.GeckoRuntime
|
||||||
import org.mozilla.geckoview.GeckoRuntimeSettings
|
import org.mozilla.geckoview.GeckoRuntimeSettings
|
||||||
|
|
||||||
@@ -34,6 +38,29 @@ object EngineProvider {
|
|||||||
if (runtime == null) {
|
if (runtime == null) {
|
||||||
Logger.debug("Creating Runtime")
|
Logger.debug("Creating Runtime")
|
||||||
val builder = GeckoRuntimeSettings.Builder()
|
val builder = GeckoRuntimeSettings.Builder()
|
||||||
|
val contentBlocking = ContentBlocking.Settings.Builder();
|
||||||
|
|
||||||
|
contentBlocking.bounceTrackingProtectionMode(when(components.contentBlocking.bounceTrackingProtectionMode) {
|
||||||
|
BounceTrackingProtectionMode.ENABLED -> EngineSession.BounceTrackingProtectionMode.ENABLED.mode
|
||||||
|
BounceTrackingProtectionMode.DISABLED -> EngineSession.BounceTrackingProtectionMode.DISABLED.mode
|
||||||
|
BounceTrackingProtectionMode.ENABLED_STANDBY -> EngineSession.BounceTrackingProtectionMode.ENABLED_STANDBY.mode
|
||||||
|
BounceTrackingProtectionMode.ENABLED_DRY_RUN -> EngineSession.BounceTrackingProtectionMode.ENABLED_DRY_RUN.mode
|
||||||
|
})
|
||||||
|
|
||||||
|
contentBlocking.queryParameterStrippingEnabled(when(components.contentBlocking.queryParameterStripping) {
|
||||||
|
QueryParameterStripping.ENABLED -> true
|
||||||
|
QueryParameterStripping.DISABLED -> false
|
||||||
|
QueryParameterStripping.PRIVATE_ONLY -> false
|
||||||
|
})
|
||||||
|
|
||||||
|
contentBlocking.queryParameterStrippingPrivateBrowsingEnabled(when(components.contentBlocking.queryParameterStripping) {
|
||||||
|
QueryParameterStripping.ENABLED -> true
|
||||||
|
QueryParameterStripping.DISABLED -> false
|
||||||
|
QueryParameterStripping.PRIVATE_ONLY -> true
|
||||||
|
})
|
||||||
|
|
||||||
|
contentBlocking.queryParameterStrippingAllowList(components.contentBlocking.queryParameterStrippingAllowList)
|
||||||
|
contentBlocking.queryParameterStrippingStripList(components.contentBlocking.queryParameterStrippingStripList)
|
||||||
|
|
||||||
// if (isCrashReportActive) {
|
// if (isCrashReportActive) {
|
||||||
// builder.crashHandler(CrashHandlerService::class.java)
|
// builder.crashHandler(CrashHandlerService::class.java)
|
||||||
@@ -45,6 +72,7 @@ object EngineProvider {
|
|||||||
builder.extensionsWebAPIEnabled(true)
|
builder.extensionsWebAPIEnabled(true)
|
||||||
builder.debugLogging(components.logLevel == Log.Priority.DEBUG)
|
builder.debugLogging(components.logLevel == Log.Priority.DEBUG)
|
||||||
builder.consoleOutput(components.logLevel == Log.Priority.DEBUG)
|
builder.consoleOutput(components.logLevel == Log.Priority.DEBUG)
|
||||||
|
builder.contentBlocking(contentBlocking.build())
|
||||||
|
|
||||||
runtime = GeckoRuntime.create(context, builder.build())
|
runtime = GeckoRuntime.create(context, builder.build())
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -8,6 +8,7 @@ package eu.weblibre.flutter_mozilla_components
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
||||||
|
import eu.weblibre.flutter_mozilla_components.pigeons.ContentBlocking
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonEvents
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoStateEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoStateEvents
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoSuggestionEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoSuggestionEvents
|
||||||
@@ -53,7 +54,8 @@ object GlobalComponents {
|
|||||||
addonEvents: GeckoAddonEvents,
|
addonEvents: GeckoAddonEvents,
|
||||||
tabContentEvents: GeckoTabContentEvents,
|
tabContentEvents: GeckoTabContentEvents,
|
||||||
extensionEvents: BrowserExtensionEvents,
|
extensionEvents: BrowserExtensionEvents,
|
||||||
logLevel: Log.Priority
|
logLevel: Log.Priority,
|
||||||
|
contentBlocking: ContentBlocking
|
||||||
) {
|
) {
|
||||||
Logger.debug("Creating new components")
|
Logger.debug("Creating new components")
|
||||||
|
|
||||||
@@ -63,9 +65,11 @@ object GlobalComponents {
|
|||||||
readerViewController,
|
readerViewController,
|
||||||
selectionAction,
|
selectionAction,
|
||||||
logLevel,
|
logLevel,
|
||||||
|
contentBlocking,
|
||||||
addonEvents,
|
addonEvents,
|
||||||
tabContentEvents,
|
tabContentEvents,
|
||||||
extensionEvents
|
extensionEvents,
|
||||||
|
|
||||||
)
|
)
|
||||||
_components = newComponents
|
_components = newComponents
|
||||||
|
|
||||||
|
|||||||
+6
-4
@@ -16,6 +16,7 @@ import eu.weblibre.flutter_mozilla_components.GlobalComponents
|
|||||||
import eu.weblibre.flutter_mozilla_components.activities.NotificationActivity
|
import eu.weblibre.flutter_mozilla_components.activities.NotificationActivity
|
||||||
import eu.weblibre.flutter_mozilla_components.feature.DefaultSelectionActionDelegate
|
import eu.weblibre.flutter_mozilla_components.feature.DefaultSelectionActionDelegate
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.BrowserExtensionEvents
|
||||||
|
import eu.weblibre.flutter_mozilla_components.pigeons.ContentBlocking
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonEvents
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonsApi
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoAddonsApi
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoBrowserApi
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoBrowserApi
|
||||||
@@ -133,7 +134,7 @@ class GeckoBrowserApiImpl : GeckoBrowserApi {
|
|||||||
isPlatformViewRegistered = false
|
isPlatformViewRegistered = false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initialize(logLevel: LogLevel) {
|
override fun initialize(logLevel: LogLevel, contentBlocking: ContentBlocking) {
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
if(!isGeckoInitialized) {
|
if(!isGeckoInitialized) {
|
||||||
val geckoLogging = GeckoLogging(_flutterPluginBinding.binaryMessenger)
|
val geckoLogging = GeckoLogging(_flutterPluginBinding.binaryMessenger)
|
||||||
@@ -147,7 +148,7 @@ class GeckoBrowserApiImpl : GeckoBrowserApi {
|
|||||||
|
|
||||||
Log.addSink(PriorityAwareLogSink(level, geckoLogging))
|
Log.addSink(PriorityAwareLogSink(level, geckoLogging))
|
||||||
|
|
||||||
setupGeckoEngine(level)
|
setupGeckoEngine(level, contentBlocking)
|
||||||
isGeckoInitialized = true
|
isGeckoInitialized = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +164,7 @@ class GeckoBrowserApiImpl : GeckoBrowserApi {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupGeckoEngine(logLevel: Log.Priority) {
|
private fun setupGeckoEngine(logLevel: Log.Priority, contentBlocking: ContentBlocking) {
|
||||||
val selectionActionEvents = GeckoSelectionActionEvents(_flutterPluginBinding.binaryMessenger)
|
val selectionActionEvents = GeckoSelectionActionEvents(_flutterPluginBinding.binaryMessenger)
|
||||||
|
|
||||||
val selectionActionDelegate = DefaultSelectionActionDelegate(selectionActionEvents) { actions ->
|
val selectionActionDelegate = DefaultSelectionActionDelegate(selectionActionEvents) { actions ->
|
||||||
@@ -193,7 +194,8 @@ class GeckoBrowserApiImpl : GeckoBrowserApi {
|
|||||||
addonEvents,
|
addonEvents,
|
||||||
tabContentEvents,
|
tabContentEvents,
|
||||||
extensionEvents,
|
extensionEvents,
|
||||||
logLevel
|
logLevel,
|
||||||
|
contentBlocking
|
||||||
)
|
)
|
||||||
|
|
||||||
GeckoEngineSettingsApi.setUp(_flutterPluginBinding.binaryMessenger, GeckoEngineSettingsApiImpl())
|
GeckoEngineSettingsApi.setUp(_flutterPluginBinding.binaryMessenger, GeckoEngineSettingsApiImpl())
|
||||||
|
|||||||
+35
@@ -12,6 +12,7 @@ import eu.weblibre.flutter_mozilla_components.pigeons.CookieBannerHandlingMode
|
|||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoEngineSettings
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoEngineSettings
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoEngineSettingsApi
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoEngineSettingsApi
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.HttpsOnlyMode
|
import eu.weblibre.flutter_mozilla_components.pigeons.HttpsOnlyMode
|
||||||
|
import eu.weblibre.flutter_mozilla_components.pigeons.QueryParameterStripping
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.WebContentIsolationStrategy
|
import eu.weblibre.flutter_mozilla_components.pigeons.WebContentIsolationStrategy
|
||||||
import mozilla.components.concept.engine.Engine
|
import mozilla.components.concept.engine.Engine
|
||||||
import mozilla.components.concept.engine.EngineSession
|
import mozilla.components.concept.engine.EngineSession
|
||||||
@@ -112,6 +113,22 @@ class GeckoEngineSettingsApiImpl : GeckoEngineSettingsApi {
|
|||||||
if(settings.userAgent != null) {
|
if(settings.userAgent != null) {
|
||||||
components.core.engineSettings.userAgentString = settings.userAgent;
|
components.core.engineSettings.userAgentString = settings.userAgent;
|
||||||
}
|
}
|
||||||
|
if(settings.contentBlocking != null) {
|
||||||
|
components.core.engineSettings.queryParameterStripping = when(settings.contentBlocking.queryParameterStripping) {
|
||||||
|
QueryParameterStripping.ENABLED -> true
|
||||||
|
QueryParameterStripping.DISABLED -> false
|
||||||
|
QueryParameterStripping.PRIVATE_ONLY -> false
|
||||||
|
}
|
||||||
|
components.core.engineSettings.queryParameterStrippingPrivateBrowsing = when(settings.contentBlocking.queryParameterStripping) {
|
||||||
|
QueryParameterStripping.ENABLED -> true
|
||||||
|
QueryParameterStripping.DISABLED -> false
|
||||||
|
QueryParameterStripping.PRIVATE_ONLY -> true
|
||||||
|
}
|
||||||
|
components.core.engineSettings.queryParameterStrippingAllowList = settings.contentBlocking.queryParameterStrippingAllowList
|
||||||
|
components.core.engineSettings.queryParameterStrippingStripList = settings.contentBlocking.queryParameterStrippingStripList
|
||||||
|
|
||||||
|
//TODO: Add bounce tracking protection when available
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateRuntimeSettings(settings: GeckoEngineSettings) {
|
override fun updateRuntimeSettings(settings: GeckoEngineSettings) {
|
||||||
@@ -162,6 +179,24 @@ class GeckoEngineSettingsApiImpl : GeckoEngineSettingsApi {
|
|||||||
components.core.engine.settings.userAgentString = components.core.engineSettings.userAgentString
|
components.core.engine.settings.userAgentString = components.core.engineSettings.userAgentString
|
||||||
reloadSession = true
|
reloadSession = true
|
||||||
}
|
}
|
||||||
|
if(settings.contentBlocking != null) {
|
||||||
|
components.core.engine.settings.queryParameterStripping = when(settings.contentBlocking.queryParameterStripping) {
|
||||||
|
QueryParameterStripping.ENABLED -> true
|
||||||
|
QueryParameterStripping.DISABLED -> false
|
||||||
|
QueryParameterStripping.PRIVATE_ONLY -> false
|
||||||
|
}
|
||||||
|
components.core.engine.settings.queryParameterStrippingPrivateBrowsing = when(settings.contentBlocking.queryParameterStripping) {
|
||||||
|
QueryParameterStripping.ENABLED -> true
|
||||||
|
QueryParameterStripping.DISABLED -> false
|
||||||
|
QueryParameterStripping.PRIVATE_ONLY -> true
|
||||||
|
}
|
||||||
|
components.core.engine.settings.queryParameterStrippingAllowList = settings.contentBlocking.queryParameterStrippingAllowList
|
||||||
|
components.core.engine.settings.queryParameterStrippingStripList = settings.contentBlocking.queryParameterStrippingStripList
|
||||||
|
|
||||||
|
//TODO: Add bounce tracking protection when available
|
||||||
|
|
||||||
|
reloadSession = true
|
||||||
|
}
|
||||||
|
|
||||||
if(reloadSession) {
|
if(reloadSession) {
|
||||||
components.useCases.sessionUseCases.reload()
|
components.useCases.sessionUseCases.reload()
|
||||||
|
|||||||
+199
-95
@@ -225,6 +225,42 @@ enum class HttpsOnlyMode(val raw: Int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class QueryParameterStripping(val raw: Int) {
|
||||||
|
DISABLED(0),
|
||||||
|
PRIVATE_ONLY(1),
|
||||||
|
ENABLED(2);
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun ofRaw(raw: Int): QueryParameterStripping? {
|
||||||
|
return values().firstOrNull { it.raw == raw }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class BounceTrackingProtectionMode(val raw: Int) {
|
||||||
|
/** Fully disabled. */
|
||||||
|
DISABLED(0),
|
||||||
|
/** Fully enabled. */
|
||||||
|
ENABLED(1),
|
||||||
|
/**
|
||||||
|
* Disabled, but collects user interaction data. Use this mode as the
|
||||||
|
* "disabled" state when the feature can be toggled on and off, e.g. via
|
||||||
|
* preferences.
|
||||||
|
*/
|
||||||
|
ENABLED_STANDBY(2),
|
||||||
|
/**
|
||||||
|
* Feature enabled, but tracker purging is only simulated. Used for
|
||||||
|
* testing and telemetry collection.
|
||||||
|
*/
|
||||||
|
ENABLED_DRY_RUN(3);
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun ofRaw(raw: Int): BounceTrackingProtectionMode? {
|
||||||
|
return values().firstOrNull { it.raw == raw }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enum class ColorScheme(val raw: Int) {
|
enum class ColorScheme(val raw: Int) {
|
||||||
SYSTEM(0),
|
SYSTEM(0),
|
||||||
LIGHT(1),
|
LIGHT(1),
|
||||||
@@ -1456,6 +1492,43 @@ data class TabContent (
|
|||||||
override fun hashCode(): Int = toList().hashCode()
|
override fun hashCode(): Int = toList().hashCode()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Generated class from Pigeon that represents data sent in messages. */
|
||||||
|
data class ContentBlocking (
|
||||||
|
val queryParameterStripping: QueryParameterStripping,
|
||||||
|
val queryParameterStrippingAllowList: String,
|
||||||
|
val queryParameterStrippingStripList: String,
|
||||||
|
val bounceTrackingProtectionMode: BounceTrackingProtectionMode
|
||||||
|
)
|
||||||
|
{
|
||||||
|
companion object {
|
||||||
|
fun fromList(pigeonVar_list: List<Any?>): ContentBlocking {
|
||||||
|
val queryParameterStripping = pigeonVar_list[0] as QueryParameterStripping
|
||||||
|
val queryParameterStrippingAllowList = pigeonVar_list[1] as String
|
||||||
|
val queryParameterStrippingStripList = pigeonVar_list[2] as String
|
||||||
|
val bounceTrackingProtectionMode = pigeonVar_list[3] as BounceTrackingProtectionMode
|
||||||
|
return ContentBlocking(queryParameterStripping, queryParameterStrippingAllowList, queryParameterStrippingStripList, bounceTrackingProtectionMode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fun toList(): List<Any?> {
|
||||||
|
return listOf(
|
||||||
|
queryParameterStripping,
|
||||||
|
queryParameterStrippingAllowList,
|
||||||
|
queryParameterStrippingStripList,
|
||||||
|
bounceTrackingProtectionMode,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
if (other !is ContentBlocking) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (this === other) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return GeckoPigeonUtils.deepEquals(toList(), other.toList()) }
|
||||||
|
|
||||||
|
override fun hashCode(): Int = toList().hashCode()
|
||||||
|
}
|
||||||
|
|
||||||
/** Generated class from Pigeon that represents data sent in messages. */
|
/** Generated class from Pigeon that represents data sent in messages. */
|
||||||
data class GeckoEngineSettings (
|
data class GeckoEngineSettings (
|
||||||
val javascriptEnabled: Boolean? = null,
|
val javascriptEnabled: Boolean? = null,
|
||||||
@@ -1468,7 +1541,8 @@ data class GeckoEngineSettings (
|
|||||||
val cookieBannerHandlingGlobalRules: Boolean? = null,
|
val cookieBannerHandlingGlobalRules: Boolean? = null,
|
||||||
val cookieBannerHandlingGlobalRulesSubFrames: Boolean? = null,
|
val cookieBannerHandlingGlobalRulesSubFrames: Boolean? = null,
|
||||||
val webContentIsolationStrategy: WebContentIsolationStrategy? = null,
|
val webContentIsolationStrategy: WebContentIsolationStrategy? = null,
|
||||||
val userAgent: String? = null
|
val userAgent: String? = null,
|
||||||
|
val contentBlocking: ContentBlocking? = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
companion object {
|
companion object {
|
||||||
@@ -1484,7 +1558,8 @@ data class GeckoEngineSettings (
|
|||||||
val cookieBannerHandlingGlobalRulesSubFrames = pigeonVar_list[8] as Boolean?
|
val cookieBannerHandlingGlobalRulesSubFrames = pigeonVar_list[8] as Boolean?
|
||||||
val webContentIsolationStrategy = pigeonVar_list[9] as WebContentIsolationStrategy?
|
val webContentIsolationStrategy = pigeonVar_list[9] as WebContentIsolationStrategy?
|
||||||
val userAgent = pigeonVar_list[10] as String?
|
val userAgent = pigeonVar_list[10] as String?
|
||||||
return GeckoEngineSettings(javascriptEnabled, trackingProtectionPolicy, httpsOnlyMode, globalPrivacyControlEnabled, preferredColorScheme, cookieBannerHandlingMode, cookieBannerHandlingModePrivateBrowsing, cookieBannerHandlingGlobalRules, cookieBannerHandlingGlobalRulesSubFrames, webContentIsolationStrategy, userAgent)
|
val contentBlocking = pigeonVar_list[11] as ContentBlocking?
|
||||||
|
return GeckoEngineSettings(javascriptEnabled, trackingProtectionPolicy, httpsOnlyMode, globalPrivacyControlEnabled, preferredColorScheme, cookieBannerHandlingMode, cookieBannerHandlingModePrivateBrowsing, cookieBannerHandlingGlobalRules, cookieBannerHandlingGlobalRulesSubFrames, webContentIsolationStrategy, userAgent, contentBlocking)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fun toList(): List<Any?> {
|
fun toList(): List<Any?> {
|
||||||
@@ -1500,6 +1575,7 @@ data class GeckoEngineSettings (
|
|||||||
cookieBannerHandlingGlobalRulesSubFrames,
|
cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
webContentIsolationStrategy,
|
webContentIsolationStrategy,
|
||||||
userAgent,
|
userAgent,
|
||||||
|
contentBlocking,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
@@ -1997,220 +2073,235 @@ private open class GeckoPigeonCodec : StandardMessageCodec() {
|
|||||||
}
|
}
|
||||||
139.toByte() -> {
|
139.toByte() -> {
|
||||||
return (readValue(buffer) as Long?)?.let {
|
return (readValue(buffer) as Long?)?.let {
|
||||||
ColorScheme.ofRaw(it.toInt())
|
QueryParameterStripping.ofRaw(it.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
140.toByte() -> {
|
140.toByte() -> {
|
||||||
return (readValue(buffer) as Long?)?.let {
|
return (readValue(buffer) as Long?)?.let {
|
||||||
CookieBannerHandlingMode.ofRaw(it.toInt())
|
BounceTrackingProtectionMode.ofRaw(it.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
141.toByte() -> {
|
141.toByte() -> {
|
||||||
return (readValue(buffer) as Long?)?.let {
|
return (readValue(buffer) as Long?)?.let {
|
||||||
WebContentIsolationStrategy.ofRaw(it.toInt())
|
ColorScheme.ofRaw(it.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
142.toByte() -> {
|
142.toByte() -> {
|
||||||
return (readValue(buffer) as Long?)?.let {
|
return (readValue(buffer) as Long?)?.let {
|
||||||
DownloadStatus.ofRaw(it.toInt())
|
CookieBannerHandlingMode.ofRaw(it.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
143.toByte() -> {
|
143.toByte() -> {
|
||||||
return (readValue(buffer) as Long?)?.let {
|
return (readValue(buffer) as Long?)?.let {
|
||||||
LogLevel.ofRaw(it.toInt())
|
WebContentIsolationStrategy.ofRaw(it.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
144.toByte() -> {
|
144.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as Long?)?.let {
|
||||||
TranslationOptions.fromList(it)
|
DownloadStatus.ofRaw(it.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
145.toByte() -> {
|
145.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as Long?)?.let {
|
||||||
ReaderState.fromList(it)
|
LogLevel.ofRaw(it.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
146.toByte() -> {
|
146.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
LastMediaAccessState.fromList(it)
|
TranslationOptions.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
147.toByte() -> {
|
147.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
HistoryMetadataKey.fromList(it)
|
ReaderState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
148.toByte() -> {
|
148.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
PackageCategoryValue.fromList(it)
|
LastMediaAccessState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
149.toByte() -> {
|
149.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ExternalPackage.fromList(it)
|
HistoryMetadataKey.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
150.toByte() -> {
|
150.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
LoadUrlFlagsValue.fromList(it)
|
PackageCategoryValue.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
151.toByte() -> {
|
151.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SourceValue.fromList(it)
|
ExternalPackage.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
152.toByte() -> {
|
152.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
TabState.fromList(it)
|
LoadUrlFlagsValue.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
153.toByte() -> {
|
153.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
RecoverableTab.fromList(it)
|
SourceValue.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
154.toByte() -> {
|
154.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
RecoverableBrowserState.fromList(it)
|
TabState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
155.toByte() -> {
|
155.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
IconRequest.fromList(it)
|
RecoverableTab.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
156.toByte() -> {
|
156.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ResourceSize.fromList(it)
|
RecoverableBrowserState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
157.toByte() -> {
|
157.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
Resource.fromList(it)
|
IconRequest.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
158.toByte() -> {
|
158.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
IconResult.fromList(it)
|
ResourceSize.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
159.toByte() -> {
|
159.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
CookiePartitionKey.fromList(it)
|
Resource.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
160.toByte() -> {
|
160.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
Cookie.fromList(it)
|
IconResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
161.toByte() -> {
|
161.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
HistoryItem.fromList(it)
|
CookiePartitionKey.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
162.toByte() -> {
|
162.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
HistoryState.fromList(it)
|
Cookie.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
163.toByte() -> {
|
163.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ReaderableState.fromList(it)
|
HistoryItem.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
164.toByte() -> {
|
164.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SecurityInfoState.fromList(it)
|
HistoryState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
165.toByte() -> {
|
165.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
TabContentState.fromList(it)
|
ReaderableState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
166.toByte() -> {
|
166.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
FindResultState.fromList(it)
|
SecurityInfoState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
167.toByte() -> {
|
167.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
CustomSelectionAction.fromList(it)
|
TabContentState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
168.toByte() -> {
|
168.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
WebExtensionData.fromList(it)
|
FindResultState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
169.toByte() -> {
|
169.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoSuggestion.fromList(it)
|
CustomSelectionAction.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
170.toByte() -> {
|
170.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
TabContent.fromList(it)
|
WebExtensionData.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
171.toByte() -> {
|
171.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoEngineSettings.fromList(it)
|
GeckoSuggestion.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
172.toByte() -> {
|
172.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
AutocompleteResult.fromList(it)
|
TabContent.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
173.toByte() -> {
|
173.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
UnknownHitResult.fromList(it)
|
ContentBlocking.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
174.toByte() -> {
|
174.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ImageHitResult.fromList(it)
|
GeckoEngineSettings.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
175.toByte() -> {
|
175.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
VideoHitResult.fromList(it)
|
AutocompleteResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
176.toByte() -> {
|
176.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
AudioHitResult.fromList(it)
|
UnknownHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
177.toByte() -> {
|
177.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ImageSrcHitResult.fromList(it)
|
ImageHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
178.toByte() -> {
|
178.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
PhoneHitResult.fromList(it)
|
VideoHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
179.toByte() -> {
|
179.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
EmailHitResult.fromList(it)
|
AudioHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
180.toByte() -> {
|
180.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeoHitResult.fromList(it)
|
ImageSrcHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
181.toByte() -> {
|
181.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
DownloadState.fromList(it)
|
PhoneHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
182.toByte() -> {
|
182.toByte() -> {
|
||||||
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
|
EmailHitResult.fromList(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
183.toByte() -> {
|
||||||
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
|
GeoHitResult.fromList(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
184.toByte() -> {
|
||||||
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
|
DownloadState.fromList(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
185.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ShareInternetResourceState.fromList(it)
|
ShareInternetResourceState.fromList(it)
|
||||||
}
|
}
|
||||||
@@ -2260,182 +2351,194 @@ private open class GeckoPigeonCodec : StandardMessageCodec() {
|
|||||||
stream.write(138)
|
stream.write(138)
|
||||||
writeValue(stream, value.raw)
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is ColorScheme -> {
|
is QueryParameterStripping -> {
|
||||||
stream.write(139)
|
stream.write(139)
|
||||||
writeValue(stream, value.raw)
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is CookieBannerHandlingMode -> {
|
is BounceTrackingProtectionMode -> {
|
||||||
stream.write(140)
|
stream.write(140)
|
||||||
writeValue(stream, value.raw)
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is WebContentIsolationStrategy -> {
|
is ColorScheme -> {
|
||||||
stream.write(141)
|
stream.write(141)
|
||||||
writeValue(stream, value.raw)
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is DownloadStatus -> {
|
is CookieBannerHandlingMode -> {
|
||||||
stream.write(142)
|
stream.write(142)
|
||||||
writeValue(stream, value.raw)
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is LogLevel -> {
|
is WebContentIsolationStrategy -> {
|
||||||
stream.write(143)
|
stream.write(143)
|
||||||
writeValue(stream, value.raw)
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is TranslationOptions -> {
|
is DownloadStatus -> {
|
||||||
stream.write(144)
|
stream.write(144)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is ReaderState -> {
|
is LogLevel -> {
|
||||||
stream.write(145)
|
stream.write(145)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.raw)
|
||||||
}
|
}
|
||||||
is LastMediaAccessState -> {
|
is TranslationOptions -> {
|
||||||
stream.write(146)
|
stream.write(146)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is HistoryMetadataKey -> {
|
is ReaderState -> {
|
||||||
stream.write(147)
|
stream.write(147)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is PackageCategoryValue -> {
|
is LastMediaAccessState -> {
|
||||||
stream.write(148)
|
stream.write(148)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ExternalPackage -> {
|
is HistoryMetadataKey -> {
|
||||||
stream.write(149)
|
stream.write(149)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is LoadUrlFlagsValue -> {
|
is PackageCategoryValue -> {
|
||||||
stream.write(150)
|
stream.write(150)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SourceValue -> {
|
is ExternalPackage -> {
|
||||||
stream.write(151)
|
stream.write(151)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is TabState -> {
|
is LoadUrlFlagsValue -> {
|
||||||
stream.write(152)
|
stream.write(152)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is RecoverableTab -> {
|
is SourceValue -> {
|
||||||
stream.write(153)
|
stream.write(153)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is RecoverableBrowserState -> {
|
is TabState -> {
|
||||||
stream.write(154)
|
stream.write(154)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is IconRequest -> {
|
is RecoverableTab -> {
|
||||||
stream.write(155)
|
stream.write(155)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ResourceSize -> {
|
is RecoverableBrowserState -> {
|
||||||
stream.write(156)
|
stream.write(156)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is Resource -> {
|
is IconRequest -> {
|
||||||
stream.write(157)
|
stream.write(157)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is IconResult -> {
|
is ResourceSize -> {
|
||||||
stream.write(158)
|
stream.write(158)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is CookiePartitionKey -> {
|
is Resource -> {
|
||||||
stream.write(159)
|
stream.write(159)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is Cookie -> {
|
is IconResult -> {
|
||||||
stream.write(160)
|
stream.write(160)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is HistoryItem -> {
|
is CookiePartitionKey -> {
|
||||||
stream.write(161)
|
stream.write(161)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is HistoryState -> {
|
is Cookie -> {
|
||||||
stream.write(162)
|
stream.write(162)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ReaderableState -> {
|
is HistoryItem -> {
|
||||||
stream.write(163)
|
stream.write(163)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SecurityInfoState -> {
|
is HistoryState -> {
|
||||||
stream.write(164)
|
stream.write(164)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is TabContentState -> {
|
is ReaderableState -> {
|
||||||
stream.write(165)
|
stream.write(165)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is FindResultState -> {
|
is SecurityInfoState -> {
|
||||||
stream.write(166)
|
stream.write(166)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is CustomSelectionAction -> {
|
is TabContentState -> {
|
||||||
stream.write(167)
|
stream.write(167)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is WebExtensionData -> {
|
is FindResultState -> {
|
||||||
stream.write(168)
|
stream.write(168)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoSuggestion -> {
|
is CustomSelectionAction -> {
|
||||||
stream.write(169)
|
stream.write(169)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is TabContent -> {
|
is WebExtensionData -> {
|
||||||
stream.write(170)
|
stream.write(170)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoEngineSettings -> {
|
is GeckoSuggestion -> {
|
||||||
stream.write(171)
|
stream.write(171)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is AutocompleteResult -> {
|
is TabContent -> {
|
||||||
stream.write(172)
|
stream.write(172)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is UnknownHitResult -> {
|
is ContentBlocking -> {
|
||||||
stream.write(173)
|
stream.write(173)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ImageHitResult -> {
|
is GeckoEngineSettings -> {
|
||||||
stream.write(174)
|
stream.write(174)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is VideoHitResult -> {
|
is AutocompleteResult -> {
|
||||||
stream.write(175)
|
stream.write(175)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is AudioHitResult -> {
|
is UnknownHitResult -> {
|
||||||
stream.write(176)
|
stream.write(176)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ImageSrcHitResult -> {
|
is ImageHitResult -> {
|
||||||
stream.write(177)
|
stream.write(177)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is PhoneHitResult -> {
|
is VideoHitResult -> {
|
||||||
stream.write(178)
|
stream.write(178)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is EmailHitResult -> {
|
is AudioHitResult -> {
|
||||||
stream.write(179)
|
stream.write(179)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeoHitResult -> {
|
is ImageSrcHitResult -> {
|
||||||
stream.write(180)
|
stream.write(180)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is DownloadState -> {
|
is PhoneHitResult -> {
|
||||||
stream.write(181)
|
stream.write(181)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ShareInternetResourceState -> {
|
is EmailHitResult -> {
|
||||||
stream.write(182)
|
stream.write(182)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
|
is GeoHitResult -> {
|
||||||
|
stream.write(183)
|
||||||
|
writeValue(stream, value.toList())
|
||||||
|
}
|
||||||
|
is DownloadState -> {
|
||||||
|
stream.write(184)
|
||||||
|
writeValue(stream, value.toList())
|
||||||
|
}
|
||||||
|
is ShareInternetResourceState -> {
|
||||||
|
stream.write(185)
|
||||||
|
writeValue(stream, value.toList())
|
||||||
|
}
|
||||||
else -> super.writeValue(stream, value)
|
else -> super.writeValue(stream, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2444,7 +2547,7 @@ private open class GeckoPigeonCodec : StandardMessageCodec() {
|
|||||||
|
|
||||||
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
|
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
|
||||||
interface GeckoBrowserApi {
|
interface GeckoBrowserApi {
|
||||||
fun initialize(logLevel: LogLevel)
|
fun initialize(logLevel: LogLevel, contentBlocking: ContentBlocking)
|
||||||
fun showNativeFragment(): Boolean
|
fun showNativeFragment(): Boolean
|
||||||
fun onTrimMemory(level: Long)
|
fun onTrimMemory(level: Long)
|
||||||
|
|
||||||
@@ -2463,8 +2566,9 @@ interface GeckoBrowserApi {
|
|||||||
channel.setMessageHandler { message, reply ->
|
channel.setMessageHandler { message, reply ->
|
||||||
val args = message as List<Any?>
|
val args = message as List<Any?>
|
||||||
val logLevelArg = args[0] as LogLevel
|
val logLevelArg = args[0] as LogLevel
|
||||||
|
val contentBlockingArg = args[1] as ContentBlocking
|
||||||
val wrapped: List<Any?> = try {
|
val wrapped: List<Any?> = try {
|
||||||
api.initialize(logLevelArg)
|
api.initialize(logLevelArg, contentBlockingArg)
|
||||||
listOf(null)
|
listOf(null)
|
||||||
} catch (exception: Throwable) {
|
} catch (exception: Throwable) {
|
||||||
GeckoPigeonUtils.wrapError(exception)
|
GeckoPigeonUtils.wrapError(exception)
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ export 'src/geckoview_widget.dart';
|
|||||||
export 'src/pigeons/gecko.g.dart'
|
export 'src/pigeons/gecko.g.dart'
|
||||||
show
|
show
|
||||||
AudioHitResult,
|
AudioHitResult,
|
||||||
|
BounceTrackingProtectionMode,
|
||||||
ColorScheme,
|
ColorScheme,
|
||||||
|
ContentBlocking,
|
||||||
CookieBannerHandlingMode,
|
CookieBannerHandlingMode,
|
||||||
CookieSameSiteStatus,
|
CookieSameSiteStatus,
|
||||||
EmailHitResult,
|
EmailHitResult,
|
||||||
@@ -48,6 +50,7 @@ export 'src/pigeons/gecko.g.dart'
|
|||||||
ImageSrcHitResult,
|
ImageSrcHitResult,
|
||||||
LogLevel,
|
LogLevel,
|
||||||
PhoneHitResult,
|
PhoneHitResult,
|
||||||
|
QueryParameterStripping,
|
||||||
Resource,
|
Resource,
|
||||||
ResourceSize,
|
ResourceSize,
|
||||||
SecurityInfoState,
|
SecurityInfoState,
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ class GeckoBrowserService {
|
|||||||
|
|
||||||
GeckoBrowserService({GeckoBrowserApi? api}) : _api = api ?? _apiInstance;
|
GeckoBrowserService({GeckoBrowserApi? api}) : _api = api ?? _apiInstance;
|
||||||
|
|
||||||
Future<void> initialize(LogLevel logLevel) {
|
Future<void> initialize(LogLevel logLevel, ContentBlocking contentBlocking) {
|
||||||
return _api.initialize(logLevel);
|
return _api.initialize(logLevel, contentBlocking);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> showNativeFragment() {
|
Future<bool> showNativeFragment() {
|
||||||
|
|||||||
@@ -84,4 +84,10 @@ class GeckoEngineSettingsService {
|
|||||||
GeckoEngineSettings(webContentIsolationStrategy: state),
|
GeckoEngineSettings(webContentIsolationStrategy: state),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> contentBlocking(ContentBlocking state) {
|
||||||
|
return _api.updateRuntimeSettings(
|
||||||
|
GeckoEngineSettings(contentBlocking: state),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,26 @@ enum HttpsOnlyMode {
|
|||||||
enabled,
|
enabled,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum QueryParameterStripping {
|
||||||
|
disabled,
|
||||||
|
privateOnly,
|
||||||
|
enabled,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum BounceTrackingProtectionMode {
|
||||||
|
/// Fully disabled.
|
||||||
|
disabled,
|
||||||
|
/// Fully enabled.
|
||||||
|
enabled,
|
||||||
|
/// Disabled, but collects user interaction data. Use this mode as the
|
||||||
|
/// "disabled" state when the feature can be toggled on and off, e.g. via
|
||||||
|
/// preferences.
|
||||||
|
enabledStandby,
|
||||||
|
/// Feature enabled, but tracker purging is only simulated. Used for
|
||||||
|
/// testing and telemetry collection.
|
||||||
|
enabledDryRun,
|
||||||
|
}
|
||||||
|
|
||||||
enum ColorScheme {
|
enum ColorScheme {
|
||||||
system,
|
system,
|
||||||
light,
|
light,
|
||||||
@@ -1790,6 +1810,62 @@ class TabContent {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ContentBlocking {
|
||||||
|
ContentBlocking({
|
||||||
|
required this.queryParameterStripping,
|
||||||
|
required this.queryParameterStrippingAllowList,
|
||||||
|
required this.queryParameterStrippingStripList,
|
||||||
|
required this.bounceTrackingProtectionMode,
|
||||||
|
});
|
||||||
|
|
||||||
|
QueryParameterStripping queryParameterStripping;
|
||||||
|
|
||||||
|
String queryParameterStrippingAllowList;
|
||||||
|
|
||||||
|
String queryParameterStrippingStripList;
|
||||||
|
|
||||||
|
BounceTrackingProtectionMode bounceTrackingProtectionMode;
|
||||||
|
|
||||||
|
List<Object?> _toList() {
|
||||||
|
return <Object?>[
|
||||||
|
queryParameterStripping,
|
||||||
|
queryParameterStrippingAllowList,
|
||||||
|
queryParameterStrippingStripList,
|
||||||
|
bounceTrackingProtectionMode,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
Object encode() {
|
||||||
|
return _toList(); }
|
||||||
|
|
||||||
|
static ContentBlocking decode(Object result) {
|
||||||
|
result as List<Object?>;
|
||||||
|
return ContentBlocking(
|
||||||
|
queryParameterStripping: result[0]! as QueryParameterStripping,
|
||||||
|
queryParameterStrippingAllowList: result[1]! as String,
|
||||||
|
queryParameterStrippingStripList: result[2]! as String,
|
||||||
|
bounceTrackingProtectionMode: result[3]! as BounceTrackingProtectionMode,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
if (other is! ContentBlocking || other.runtimeType != runtimeType) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (identical(this, other)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return _deepEquals(encode(), other.encode());
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||||
|
int get hashCode => Object.hashAll(_toList())
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
class GeckoEngineSettings {
|
class GeckoEngineSettings {
|
||||||
GeckoEngineSettings({
|
GeckoEngineSettings({
|
||||||
this.javascriptEnabled,
|
this.javascriptEnabled,
|
||||||
@@ -1803,6 +1879,7 @@ class GeckoEngineSettings {
|
|||||||
this.cookieBannerHandlingGlobalRulesSubFrames,
|
this.cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
this.webContentIsolationStrategy,
|
this.webContentIsolationStrategy,
|
||||||
this.userAgent,
|
this.userAgent,
|
||||||
|
this.contentBlocking,
|
||||||
});
|
});
|
||||||
|
|
||||||
bool? javascriptEnabled;
|
bool? javascriptEnabled;
|
||||||
@@ -1827,6 +1904,8 @@ class GeckoEngineSettings {
|
|||||||
|
|
||||||
String? userAgent;
|
String? userAgent;
|
||||||
|
|
||||||
|
ContentBlocking? contentBlocking;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[
|
return <Object?>[
|
||||||
javascriptEnabled,
|
javascriptEnabled,
|
||||||
@@ -1840,6 +1919,7 @@ class GeckoEngineSettings {
|
|||||||
cookieBannerHandlingGlobalRulesSubFrames,
|
cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
webContentIsolationStrategy,
|
webContentIsolationStrategy,
|
||||||
userAgent,
|
userAgent,
|
||||||
|
contentBlocking,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1860,6 +1940,7 @@ class GeckoEngineSettings {
|
|||||||
cookieBannerHandlingGlobalRulesSubFrames: result[8] as bool?,
|
cookieBannerHandlingGlobalRulesSubFrames: result[8] as bool?,
|
||||||
webContentIsolationStrategy: result[9] as WebContentIsolationStrategy?,
|
webContentIsolationStrategy: result[9] as WebContentIsolationStrategy?,
|
||||||
userAgent: result[10] as String?,
|
userAgent: result[10] as String?,
|
||||||
|
contentBlocking: result[11] as ContentBlocking?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2518,138 +2599,147 @@ class _PigeonCodec extends StandardMessageCodec {
|
|||||||
} else if (value is HttpsOnlyMode) {
|
} else if (value is HttpsOnlyMode) {
|
||||||
buffer.putUint8(138);
|
buffer.putUint8(138);
|
||||||
writeValue(buffer, value.index);
|
writeValue(buffer, value.index);
|
||||||
} else if (value is ColorScheme) {
|
} else if (value is QueryParameterStripping) {
|
||||||
buffer.putUint8(139);
|
buffer.putUint8(139);
|
||||||
writeValue(buffer, value.index);
|
writeValue(buffer, value.index);
|
||||||
} else if (value is CookieBannerHandlingMode) {
|
} else if (value is BounceTrackingProtectionMode) {
|
||||||
buffer.putUint8(140);
|
buffer.putUint8(140);
|
||||||
writeValue(buffer, value.index);
|
writeValue(buffer, value.index);
|
||||||
} else if (value is WebContentIsolationStrategy) {
|
} else if (value is ColorScheme) {
|
||||||
buffer.putUint8(141);
|
buffer.putUint8(141);
|
||||||
writeValue(buffer, value.index);
|
writeValue(buffer, value.index);
|
||||||
} else if (value is DownloadStatus) {
|
} else if (value is CookieBannerHandlingMode) {
|
||||||
buffer.putUint8(142);
|
buffer.putUint8(142);
|
||||||
writeValue(buffer, value.index);
|
writeValue(buffer, value.index);
|
||||||
} else if (value is LogLevel) {
|
} else if (value is WebContentIsolationStrategy) {
|
||||||
buffer.putUint8(143);
|
buffer.putUint8(143);
|
||||||
writeValue(buffer, value.index);
|
writeValue(buffer, value.index);
|
||||||
} else if (value is TranslationOptions) {
|
} else if (value is DownloadStatus) {
|
||||||
buffer.putUint8(144);
|
buffer.putUint8(144);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.index);
|
||||||
} else if (value is ReaderState) {
|
} else if (value is LogLevel) {
|
||||||
buffer.putUint8(145);
|
buffer.putUint8(145);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.index);
|
||||||
} else if (value is LastMediaAccessState) {
|
} else if (value is TranslationOptions) {
|
||||||
buffer.putUint8(146);
|
buffer.putUint8(146);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is HistoryMetadataKey) {
|
} else if (value is ReaderState) {
|
||||||
buffer.putUint8(147);
|
buffer.putUint8(147);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is PackageCategoryValue) {
|
} else if (value is LastMediaAccessState) {
|
||||||
buffer.putUint8(148);
|
buffer.putUint8(148);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ExternalPackage) {
|
} else if (value is HistoryMetadataKey) {
|
||||||
buffer.putUint8(149);
|
buffer.putUint8(149);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is LoadUrlFlagsValue) {
|
} else if (value is PackageCategoryValue) {
|
||||||
buffer.putUint8(150);
|
buffer.putUint8(150);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SourceValue) {
|
} else if (value is ExternalPackage) {
|
||||||
buffer.putUint8(151);
|
buffer.putUint8(151);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is TabState) {
|
} else if (value is LoadUrlFlagsValue) {
|
||||||
buffer.putUint8(152);
|
buffer.putUint8(152);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is RecoverableTab) {
|
} else if (value is SourceValue) {
|
||||||
buffer.putUint8(153);
|
buffer.putUint8(153);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is RecoverableBrowserState) {
|
} else if (value is TabState) {
|
||||||
buffer.putUint8(154);
|
buffer.putUint8(154);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is IconRequest) {
|
} else if (value is RecoverableTab) {
|
||||||
buffer.putUint8(155);
|
buffer.putUint8(155);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ResourceSize) {
|
} else if (value is RecoverableBrowserState) {
|
||||||
buffer.putUint8(156);
|
buffer.putUint8(156);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is Resource) {
|
} else if (value is IconRequest) {
|
||||||
buffer.putUint8(157);
|
buffer.putUint8(157);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is IconResult) {
|
} else if (value is ResourceSize) {
|
||||||
buffer.putUint8(158);
|
buffer.putUint8(158);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is CookiePartitionKey) {
|
} else if (value is Resource) {
|
||||||
buffer.putUint8(159);
|
buffer.putUint8(159);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is Cookie) {
|
} else if (value is IconResult) {
|
||||||
buffer.putUint8(160);
|
buffer.putUint8(160);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is HistoryItem) {
|
} else if (value is CookiePartitionKey) {
|
||||||
buffer.putUint8(161);
|
buffer.putUint8(161);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is HistoryState) {
|
} else if (value is Cookie) {
|
||||||
buffer.putUint8(162);
|
buffer.putUint8(162);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ReaderableState) {
|
} else if (value is HistoryItem) {
|
||||||
buffer.putUint8(163);
|
buffer.putUint8(163);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SecurityInfoState) {
|
} else if (value is HistoryState) {
|
||||||
buffer.putUint8(164);
|
buffer.putUint8(164);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is TabContentState) {
|
} else if (value is ReaderableState) {
|
||||||
buffer.putUint8(165);
|
buffer.putUint8(165);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is FindResultState) {
|
} else if (value is SecurityInfoState) {
|
||||||
buffer.putUint8(166);
|
buffer.putUint8(166);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is CustomSelectionAction) {
|
} else if (value is TabContentState) {
|
||||||
buffer.putUint8(167);
|
buffer.putUint8(167);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is WebExtensionData) {
|
} else if (value is FindResultState) {
|
||||||
buffer.putUint8(168);
|
buffer.putUint8(168);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoSuggestion) {
|
} else if (value is CustomSelectionAction) {
|
||||||
buffer.putUint8(169);
|
buffer.putUint8(169);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is TabContent) {
|
} else if (value is WebExtensionData) {
|
||||||
buffer.putUint8(170);
|
buffer.putUint8(170);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoEngineSettings) {
|
} else if (value is GeckoSuggestion) {
|
||||||
buffer.putUint8(171);
|
buffer.putUint8(171);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is AutocompleteResult) {
|
} else if (value is TabContent) {
|
||||||
buffer.putUint8(172);
|
buffer.putUint8(172);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is UnknownHitResult) {
|
} else if (value is ContentBlocking) {
|
||||||
buffer.putUint8(173);
|
buffer.putUint8(173);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ImageHitResult) {
|
} else if (value is GeckoEngineSettings) {
|
||||||
buffer.putUint8(174);
|
buffer.putUint8(174);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is VideoHitResult) {
|
} else if (value is AutocompleteResult) {
|
||||||
buffer.putUint8(175);
|
buffer.putUint8(175);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is AudioHitResult) {
|
} else if (value is UnknownHitResult) {
|
||||||
buffer.putUint8(176);
|
buffer.putUint8(176);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ImageSrcHitResult) {
|
} else if (value is ImageHitResult) {
|
||||||
buffer.putUint8(177);
|
buffer.putUint8(177);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is PhoneHitResult) {
|
} else if (value is VideoHitResult) {
|
||||||
buffer.putUint8(178);
|
buffer.putUint8(178);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is EmailHitResult) {
|
} else if (value is AudioHitResult) {
|
||||||
buffer.putUint8(179);
|
buffer.putUint8(179);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeoHitResult) {
|
} else if (value is ImageSrcHitResult) {
|
||||||
buffer.putUint8(180);
|
buffer.putUint8(180);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is DownloadState) {
|
} else if (value is PhoneHitResult) {
|
||||||
buffer.putUint8(181);
|
buffer.putUint8(181);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ShareInternetResourceState) {
|
} else if (value is EmailHitResult) {
|
||||||
buffer.putUint8(182);
|
buffer.putUint8(182);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
|
} else if (value is GeoHitResult) {
|
||||||
|
buffer.putUint8(183);
|
||||||
|
writeValue(buffer, value.encode());
|
||||||
|
} else if (value is DownloadState) {
|
||||||
|
buffer.putUint8(184);
|
||||||
|
writeValue(buffer, value.encode());
|
||||||
|
} else if (value is ShareInternetResourceState) {
|
||||||
|
buffer.putUint8(185);
|
||||||
|
writeValue(buffer, value.encode());
|
||||||
} else {
|
} else {
|
||||||
super.writeValue(buffer, value);
|
super.writeValue(buffer, value);
|
||||||
}
|
}
|
||||||
@@ -2690,96 +2780,104 @@ class _PigeonCodec extends StandardMessageCodec {
|
|||||||
return value == null ? null : HttpsOnlyMode.values[value];
|
return value == null ? null : HttpsOnlyMode.values[value];
|
||||||
case 139:
|
case 139:
|
||||||
final int? value = readValue(buffer) as int?;
|
final int? value = readValue(buffer) as int?;
|
||||||
return value == null ? null : ColorScheme.values[value];
|
return value == null ? null : QueryParameterStripping.values[value];
|
||||||
case 140:
|
case 140:
|
||||||
final int? value = readValue(buffer) as int?;
|
final int? value = readValue(buffer) as int?;
|
||||||
return value == null ? null : CookieBannerHandlingMode.values[value];
|
return value == null ? null : BounceTrackingProtectionMode.values[value];
|
||||||
case 141:
|
case 141:
|
||||||
final int? value = readValue(buffer) as int?;
|
final int? value = readValue(buffer) as int?;
|
||||||
return value == null ? null : WebContentIsolationStrategy.values[value];
|
return value == null ? null : ColorScheme.values[value];
|
||||||
case 142:
|
case 142:
|
||||||
final int? value = readValue(buffer) as int?;
|
final int? value = readValue(buffer) as int?;
|
||||||
return value == null ? null : DownloadStatus.values[value];
|
return value == null ? null : CookieBannerHandlingMode.values[value];
|
||||||
case 143:
|
case 143:
|
||||||
final int? value = readValue(buffer) as int?;
|
final int? value = readValue(buffer) as int?;
|
||||||
return value == null ? null : LogLevel.values[value];
|
return value == null ? null : WebContentIsolationStrategy.values[value];
|
||||||
case 144:
|
case 144:
|
||||||
return TranslationOptions.decode(readValue(buffer)!);
|
final int? value = readValue(buffer) as int?;
|
||||||
|
return value == null ? null : DownloadStatus.values[value];
|
||||||
case 145:
|
case 145:
|
||||||
return ReaderState.decode(readValue(buffer)!);
|
final int? value = readValue(buffer) as int?;
|
||||||
|
return value == null ? null : LogLevel.values[value];
|
||||||
case 146:
|
case 146:
|
||||||
return LastMediaAccessState.decode(readValue(buffer)!);
|
return TranslationOptions.decode(readValue(buffer)!);
|
||||||
case 147:
|
case 147:
|
||||||
return HistoryMetadataKey.decode(readValue(buffer)!);
|
return ReaderState.decode(readValue(buffer)!);
|
||||||
case 148:
|
case 148:
|
||||||
return PackageCategoryValue.decode(readValue(buffer)!);
|
return LastMediaAccessState.decode(readValue(buffer)!);
|
||||||
case 149:
|
case 149:
|
||||||
return ExternalPackage.decode(readValue(buffer)!);
|
return HistoryMetadataKey.decode(readValue(buffer)!);
|
||||||
case 150:
|
case 150:
|
||||||
return LoadUrlFlagsValue.decode(readValue(buffer)!);
|
return PackageCategoryValue.decode(readValue(buffer)!);
|
||||||
case 151:
|
case 151:
|
||||||
return SourceValue.decode(readValue(buffer)!);
|
return ExternalPackage.decode(readValue(buffer)!);
|
||||||
case 152:
|
case 152:
|
||||||
return TabState.decode(readValue(buffer)!);
|
return LoadUrlFlagsValue.decode(readValue(buffer)!);
|
||||||
case 153:
|
case 153:
|
||||||
return RecoverableTab.decode(readValue(buffer)!);
|
return SourceValue.decode(readValue(buffer)!);
|
||||||
case 154:
|
case 154:
|
||||||
return RecoverableBrowserState.decode(readValue(buffer)!);
|
return TabState.decode(readValue(buffer)!);
|
||||||
case 155:
|
case 155:
|
||||||
return IconRequest.decode(readValue(buffer)!);
|
return RecoverableTab.decode(readValue(buffer)!);
|
||||||
case 156:
|
case 156:
|
||||||
return ResourceSize.decode(readValue(buffer)!);
|
return RecoverableBrowserState.decode(readValue(buffer)!);
|
||||||
case 157:
|
case 157:
|
||||||
return Resource.decode(readValue(buffer)!);
|
return IconRequest.decode(readValue(buffer)!);
|
||||||
case 158:
|
case 158:
|
||||||
return IconResult.decode(readValue(buffer)!);
|
return ResourceSize.decode(readValue(buffer)!);
|
||||||
case 159:
|
case 159:
|
||||||
return CookiePartitionKey.decode(readValue(buffer)!);
|
return Resource.decode(readValue(buffer)!);
|
||||||
case 160:
|
case 160:
|
||||||
return Cookie.decode(readValue(buffer)!);
|
return IconResult.decode(readValue(buffer)!);
|
||||||
case 161:
|
case 161:
|
||||||
return HistoryItem.decode(readValue(buffer)!);
|
return CookiePartitionKey.decode(readValue(buffer)!);
|
||||||
case 162:
|
case 162:
|
||||||
return HistoryState.decode(readValue(buffer)!);
|
return Cookie.decode(readValue(buffer)!);
|
||||||
case 163:
|
case 163:
|
||||||
return ReaderableState.decode(readValue(buffer)!);
|
return HistoryItem.decode(readValue(buffer)!);
|
||||||
case 164:
|
case 164:
|
||||||
return SecurityInfoState.decode(readValue(buffer)!);
|
return HistoryState.decode(readValue(buffer)!);
|
||||||
case 165:
|
case 165:
|
||||||
return TabContentState.decode(readValue(buffer)!);
|
return ReaderableState.decode(readValue(buffer)!);
|
||||||
case 166:
|
case 166:
|
||||||
return FindResultState.decode(readValue(buffer)!);
|
return SecurityInfoState.decode(readValue(buffer)!);
|
||||||
case 167:
|
case 167:
|
||||||
return CustomSelectionAction.decode(readValue(buffer)!);
|
return TabContentState.decode(readValue(buffer)!);
|
||||||
case 168:
|
case 168:
|
||||||
return WebExtensionData.decode(readValue(buffer)!);
|
return FindResultState.decode(readValue(buffer)!);
|
||||||
case 169:
|
case 169:
|
||||||
return GeckoSuggestion.decode(readValue(buffer)!);
|
return CustomSelectionAction.decode(readValue(buffer)!);
|
||||||
case 170:
|
case 170:
|
||||||
return TabContent.decode(readValue(buffer)!);
|
return WebExtensionData.decode(readValue(buffer)!);
|
||||||
case 171:
|
case 171:
|
||||||
return GeckoEngineSettings.decode(readValue(buffer)!);
|
return GeckoSuggestion.decode(readValue(buffer)!);
|
||||||
case 172:
|
case 172:
|
||||||
return AutocompleteResult.decode(readValue(buffer)!);
|
return TabContent.decode(readValue(buffer)!);
|
||||||
case 173:
|
case 173:
|
||||||
return UnknownHitResult.decode(readValue(buffer)!);
|
return ContentBlocking.decode(readValue(buffer)!);
|
||||||
case 174:
|
case 174:
|
||||||
return ImageHitResult.decode(readValue(buffer)!);
|
return GeckoEngineSettings.decode(readValue(buffer)!);
|
||||||
case 175:
|
case 175:
|
||||||
return VideoHitResult.decode(readValue(buffer)!);
|
return AutocompleteResult.decode(readValue(buffer)!);
|
||||||
case 176:
|
case 176:
|
||||||
return AudioHitResult.decode(readValue(buffer)!);
|
return UnknownHitResult.decode(readValue(buffer)!);
|
||||||
case 177:
|
case 177:
|
||||||
return ImageSrcHitResult.decode(readValue(buffer)!);
|
return ImageHitResult.decode(readValue(buffer)!);
|
||||||
case 178:
|
case 178:
|
||||||
return PhoneHitResult.decode(readValue(buffer)!);
|
return VideoHitResult.decode(readValue(buffer)!);
|
||||||
case 179:
|
case 179:
|
||||||
return EmailHitResult.decode(readValue(buffer)!);
|
return AudioHitResult.decode(readValue(buffer)!);
|
||||||
case 180:
|
case 180:
|
||||||
return GeoHitResult.decode(readValue(buffer)!);
|
return ImageSrcHitResult.decode(readValue(buffer)!);
|
||||||
case 181:
|
case 181:
|
||||||
return DownloadState.decode(readValue(buffer)!);
|
return PhoneHitResult.decode(readValue(buffer)!);
|
||||||
case 182:
|
case 182:
|
||||||
|
return EmailHitResult.decode(readValue(buffer)!);
|
||||||
|
case 183:
|
||||||
|
return GeoHitResult.decode(readValue(buffer)!);
|
||||||
|
case 184:
|
||||||
|
return DownloadState.decode(readValue(buffer)!);
|
||||||
|
case 185:
|
||||||
return ShareInternetResourceState.decode(readValue(buffer)!);
|
return ShareInternetResourceState.decode(readValue(buffer)!);
|
||||||
default:
|
default:
|
||||||
return super.readValueOfType(type, buffer);
|
return super.readValueOfType(type, buffer);
|
||||||
@@ -2800,14 +2898,14 @@ class GeckoBrowserApi {
|
|||||||
|
|
||||||
final String pigeonVar_messageChannelSuffix;
|
final String pigeonVar_messageChannelSuffix;
|
||||||
|
|
||||||
Future<void> initialize(LogLevel logLevel) async {
|
Future<void> initialize(LogLevel logLevel, ContentBlocking contentBlocking) async {
|
||||||
final String pigeonVar_channelName = 'dev.flutter.pigeon.flutter_mozilla_components.GeckoBrowserApi.initialize$pigeonVar_messageChannelSuffix';
|
final String pigeonVar_channelName = 'dev.flutter.pigeon.flutter_mozilla_components.GeckoBrowserApi.initialize$pigeonVar_messageChannelSuffix';
|
||||||
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[logLevel]);
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[logLevel, contentBlocking]);
|
||||||
final List<Object?>? pigeonVar_replyList =
|
final List<Object?>? pigeonVar_replyList =
|
||||||
await pigeonVar_sendFuture as List<Object?>?;
|
await pigeonVar_sendFuture as List<Object?>?;
|
||||||
if (pigeonVar_replyList == null) {
|
if (pigeonVar_replyList == null) {
|
||||||
|
|||||||
@@ -536,6 +536,25 @@ enum TrackingProtectionPolicy { none, recommended, strict, custom }
|
|||||||
|
|
||||||
enum HttpsOnlyMode { disabled, privateOnly, enabled }
|
enum HttpsOnlyMode { disabled, privateOnly, enabled }
|
||||||
|
|
||||||
|
enum QueryParameterStripping { disabled, privateOnly, enabled }
|
||||||
|
|
||||||
|
enum BounceTrackingProtectionMode {
|
||||||
|
/// Fully disabled.
|
||||||
|
disabled,
|
||||||
|
|
||||||
|
/// Fully enabled.
|
||||||
|
enabled,
|
||||||
|
|
||||||
|
/// Disabled, but collects user interaction data. Use this mode as the
|
||||||
|
/// "disabled" state when the feature can be toggled on and off, e.g. via
|
||||||
|
/// preferences.
|
||||||
|
enabledStandby,
|
||||||
|
|
||||||
|
/// Feature enabled, but tracker purging is only simulated. Used for
|
||||||
|
/// testing and telemetry collection.
|
||||||
|
enabledDryRun,
|
||||||
|
}
|
||||||
|
|
||||||
enum ColorScheme { system, light, dark }
|
enum ColorScheme { system, light, dark }
|
||||||
|
|
||||||
enum CookieBannerHandlingMode { disabled, rejectAll, rejectOrAcceptAll }
|
enum CookieBannerHandlingMode { disabled, rejectAll, rejectOrAcceptAll }
|
||||||
@@ -546,6 +565,20 @@ enum WebContentIsolationStrategy {
|
|||||||
isolateHighValue,
|
isolateHighValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ContentBlocking {
|
||||||
|
QueryParameterStripping queryParameterStripping;
|
||||||
|
String queryParameterStrippingAllowList;
|
||||||
|
String queryParameterStrippingStripList;
|
||||||
|
BounceTrackingProtectionMode bounceTrackingProtectionMode;
|
||||||
|
|
||||||
|
ContentBlocking(
|
||||||
|
this.queryParameterStripping,
|
||||||
|
this.queryParameterStrippingAllowList,
|
||||||
|
this.queryParameterStrippingStripList,
|
||||||
|
this.bounceTrackingProtectionMode,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
class GeckoEngineSettings {
|
class GeckoEngineSettings {
|
||||||
final bool? javascriptEnabled;
|
final bool? javascriptEnabled;
|
||||||
final TrackingProtectionPolicy? trackingProtectionPolicy;
|
final TrackingProtectionPolicy? trackingProtectionPolicy;
|
||||||
@@ -558,6 +591,7 @@ class GeckoEngineSettings {
|
|||||||
final bool? cookieBannerHandlingGlobalRulesSubFrames;
|
final bool? cookieBannerHandlingGlobalRulesSubFrames;
|
||||||
final WebContentIsolationStrategy? webContentIsolationStrategy;
|
final WebContentIsolationStrategy? webContentIsolationStrategy;
|
||||||
final String? userAgent;
|
final String? userAgent;
|
||||||
|
final ContentBlocking? contentBlocking;
|
||||||
|
|
||||||
GeckoEngineSettings(
|
GeckoEngineSettings(
|
||||||
this.javascriptEnabled,
|
this.javascriptEnabled,
|
||||||
@@ -571,6 +605,7 @@ class GeckoEngineSettings {
|
|||||||
this.cookieBannerHandlingGlobalRulesSubFrames,
|
this.cookieBannerHandlingGlobalRulesSubFrames,
|
||||||
this.webContentIsolationStrategy,
|
this.webContentIsolationStrategy,
|
||||||
this.userAgent,
|
this.userAgent,
|
||||||
|
this.contentBlocking,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -748,7 +783,7 @@ enum LogLevel { debug, info, warn, error }
|
|||||||
)
|
)
|
||||||
@HostApi()
|
@HostApi()
|
||||||
abstract class GeckoBrowserApi {
|
abstract class GeckoBrowserApi {
|
||||||
void initialize(LogLevel logLevel);
|
void initialize(LogLevel logLevel, ContentBlocking contentBlocking);
|
||||||
bool showNativeFragment();
|
bool showNativeFragment();
|
||||||
void onTrimMemory(int level);
|
void onTrimMemory(int level);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user