   func crawlerDidFinish(_ crawler: Crawler)
 }
 
-extension CrawlerDelegate {
-  // Make crawler(crawler:url:) optional.
+public extension CrawlerDelegate {
+  // Make crawler(crawler:shouldVisitUrl:) optional.
+  func crawler(_ crawler: Crawler, shouldVisitUrl url: URL) -> Bool { true }
+
+  // Make crawler(crawler:willVisitUrl:) optional.
   func crawler(_ crawler: Crawler, willVisitUrl url: URL) {}
 }
 

      return
    }

    if visitedPages.contains(pageToVisit) {
      crawl()
    } else {
      visit(page: pageToVisit)
    }
  }



/// Receiver of crawler-related events.
public protocol CrawlerDelegate: AnyObject {

  /// Called before the crawler visits a webpage.
  ///
  /// A skipped webpage is not considered among the visited pages.
  func crawler(_ crawler: Crawler, shouldVisitUrl url: URL) -> Bool

  /// Called whenever the crawler is about to visit a new webpage.
  func crawler(_ crawler: Crawler, willVisitUrl url: URL)
