chrome.debugger: allow attaching to pages having frames with empty URLs

Originally regressed by https://chromium-review.googlesource.com/c/chromium/src/+/2412799

Bug: 1143221
Change-Id: I8323b97ecf556d6ad27d1b34d1357479bb208843
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2511749
Commit-Queue: Andrey Kosyakov <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Dmitry Gozman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#823436}
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index 4be0073b..b2858ef 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -92,6 +92,10 @@
                              const GURL& url,
                              Profile* profile,
                              std::string* error) {
+  // Allow the extension to attach to about:blank and empty URLs.
+  if (url.is_empty() || url == "about:")
+    return true;
+
   if (url == content::kUnreachableWebDataURL)
     return true;
 
@@ -401,9 +405,6 @@
                                                  bool is_webui) {
   if (is_webui)
     return false;
-  // Allow the extension to attach to about:blank.
-  if (url.is_empty() || url == "about:")
-    return true;
   std::string error;
   if (!ExtensionMayAttachToURL(*extension_, url, profile_, &error))
     return false;