filter out non http schemes
This commit is contained in:
+7
@@ -25,6 +25,8 @@ import 'package:weblibre/features/geckoview/features/browser/presentation/widget
|
|||||||
|
|
||||||
part 'site_settings_badge_provider.g.dart';
|
part 'site_settings_badge_provider.g.dart';
|
||||||
|
|
||||||
|
const _supportedSchemes = {'http', 'https'};
|
||||||
|
|
||||||
/// Provider that determines whether to show the site settings badge on the tab icon.
|
/// Provider that determines whether to show the site settings badge on the tab icon.
|
||||||
/// Returns true if any site-specific setting has been altered from defaults.
|
/// Returns true if any site-specific setting has been altered from defaults.
|
||||||
@Riverpod()
|
@Riverpod()
|
||||||
@@ -39,6 +41,11 @@ Future<bool> showSiteSettingsBadge(Ref ref) async {
|
|||||||
hasTrackingProtectionExceptionProvider(tabState.id).future,
|
hasTrackingProtectionExceptionProvider(tabState.id).future,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!tabState.url.hasScheme ||
|
||||||
|
!_supportedSchemes.contains(tabState.url.scheme)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Watch site permissions
|
// Watch site permissions
|
||||||
final permissions = await ref.watch(
|
final permissions = await ref.watch(
|
||||||
sitePermissionsRepositoryProvider(
|
sitePermissionsRepositoryProvider(
|
||||||
|
|||||||
Reference in New Issue
Block a user