decide method

ArmorNavigation decide(
  1. String url, {
  2. bool isMainFrame = true,
})

Frames inside the page (chat widgets, embeds) are allowed; only moving the whole page is checked.

Implementation

ArmorNavigation decide(String url, {bool isMainFrame = true}) {
  if (!isMainFrame) return ArmorNavigation.allow;
  final Uri? uri = Uri.tryParse(url);
  if (uri == null) return ArmorNavigation.block;
  if (isAllowed(uri)) return ArmorNavigation.allow;
  if (externalSchemes.contains(uri.scheme)) {
    return ArmorNavigation.openExternally;
  }
  return ArmorNavigation.block;
}