Using chrome.debugger.attach throws error "Cannot attach to this target." when google docs is loaded

Viewed 940

I'm currently writing a Google Chrome extension that uses the Chrome Debugger to log network activity (among other things). However, since Chrome v. 69 has been released, I notice that attaching to any tab where Google Drive or Google Docs is loaded fails. chrome.runtime.lastError tells me that it Cannot attach to this target. -- but doesn't give any more detail. I do not observe this behavior in Chromium (neither version 69 nor 71), but do observe this behavior in Chrome Canary (v. 71) as well as the current stable release (v. 69).

Here are my permissions in the manifest:

"permissions": [
  "storage",
  "debugger",
  "tabs",
  "<all_urls>"
]

And I'm connecting to the tab like so:

chrome.debugger.attach({tabId: theTab.id}, "1.2", function () { /* code... */ });

I've searched around and haven't found anything... I can't tell if Google has outright blocked access to the debugger on Drive/Docs, if it's a mistake on my part, or what. It works just fine on other Google products and elsewhere (e.g. on StackOverflow).

Does anyone have any idea where I went wrong, and/or how I could go about circumventing this restriction? Is there a permission I'm missing? Is it documented anywhere that Drive/Docs has specific restrictions?

Any help is very much appreciated.

0 Answers
Related