Extends the Chrome Developer Tools, adding a new Network Panel in the Developer Tools window with better searching and response previews. https://leviolson.com/posts/chrome-ext-better-network-panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
681 B

4 years ago
  1. const tab_log = function(json_args) {
  2. var args = JSON.parse(unescape(json_args));
  3. console[args[0]].apply(console, Array.prototype.slice.call(args, 1));
  4. }
  5. chrome.runtime.onMessage.addListener(function(request, sender, sendResponseParam) {
  6. if (request.command == 'scrub') {
  7. chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
  8. chrome.tabs.sendMessage(tabs[0].id, {command: request.command}, function(response) {
  9. console.log(response);
  10. });
  11. });
  12. } else if (request.command == 'sendToConsole') {
  13. chrome.tabs.executeScript(request.tabId, {
  14. code: "("+ tab_log + ")('" + request.args + "');",
  15. });
  16. }
  17. });