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';
|
||||
|
||||
const _supportedSchemes = {'http', 'https'};
|
||||
|
||||
/// 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.
|
||||
@Riverpod()
|
||||
@@ -39,6 +41,11 @@ Future<bool> showSiteSettingsBadge(Ref ref) async {
|
||||
hasTrackingProtectionExceptionProvider(tabState.id).future,
|
||||
);
|
||||
|
||||
if (!tabState.url.hasScheme ||
|
||||
!_supportedSchemes.contains(tabState.url.scheme)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Watch site permissions
|
||||
final permissions = await ref.watch(
|
||||
sitePermissionsRepositoryProvider(
|
||||
|
||||
Reference in New Issue
Block a user