0

I have a script in my Chrome Extension included in the <script src="myscript.js"> mode. How can I write to the console from myscript.js?

A code snippet from myscript.js:

try {
      fields = normalizeFields(JSON.parse(data).fields);
    } catch (e) {
      console.error(data, e);

      console.log(data);
      console.log(e);
      return alert('Unable to parse response from server, try again.');
    }

The alert is firing, but the console.log(data) isn't. The background page does show the error, but it's a bit cryptic and seeing all the data would make debugging significantly easier.

Thanks!

extensionhelp
  • 564
  • 1
  • 4
  • 18

0 Answers0