1

I'm currently using the "Developer mode" on the chrome://extensions page of the chromium browser, loading it by clicking on "Reload (Ctrl+R)".

I'd like to be able to make a change to my unpacked chrome extension and load it into the browser in an automated way, especially since I'm testing the extension on a virtual machine so doing all this completely headlessly would be ideal. However, I would at least like to avoid having to click every time I want to load my extension, and I'd like to be able to collect any errors produced into a file/tty.

What is the best way of doing this? Does chrome provide tools for automating extension building and testing?

Regarding the other question linked below: It doesn't really address my problem, since I am looking for a way to get console output, stack traces and any output generated by the extension reload to be accessible via a file/stream in my OS, as opposed to being displayed in a chromium browser window. The linked answers provide a way to reload the extension programmatically, but not much else.

ealfonso
  • 6,622
  • 5
  • 39
  • 67
  • possible duplicate of [How do I auto-reload a Chrome extension I'm developing?](http://stackoverflow.com/questions/2963260/how-do-i-auto-reload-a-chrome-extension-im-developing) – rsanchez Jun 18 '15 at 21:13
  • It doesn't address my problem, since I am looking for a way to get console output, stack traces and any output generated by the extension reload to be accessible via a file in my OS, as opposed to being displayed in a chromium browser window – ealfonso Jun 19 '15 at 06:52

1 Answers1

2

There are a few avenues for you to research.

  1. You could look into enabling logging with a high verbosity. In principle, I would think there is a level that echoes console output; I'm no expert though.

  2. You could use Native Messaging to speak to a daemon that will log things for you; the downside is that you probably can't catch errors this way.

  3. You could take this one step further and create an extension that attaches to your target extension with Remote Debugging protocol (which provides the same info as DevTools) using the chrome.debugger API, and then log stuff with Native Messaging.

  4. Or, you could eschew using an extension as a supervisor and just use/write an external Remote Debugging client.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • Thanks, I might look into those. I was thinking of getting swank-js to work and was curious if extensions could be loaded/managed in this way. But currently swank-js is badly or not at all maintained. – ealfonso Jun 19 '15 at 17:27