2

As the long title suggests, I would like to know what are the differences between a normal extension (popup) and one that adds a new tab in developer tools. A good example for the latter would be Observe Point.

I am new to Chrome Extensions. I tried to do a research about it, but I failed to find the answer. There seems to be little information about extensions that are hidden, like Observe Point.

I need to know if is possible to intercept a response from a server using normal extension. But it would also be nice to know the differences between them.

Thank you in advance!

Community
  • 1
  • 1
AlexD
  • 55
  • 1
  • 5
  • When you are saying the differences between normal extension(popup) and Observe Point, what exactly do you mean? And as for normal extension(popup), do you mean an extension with a [popup](https://developer.chrome.com/extensions/browserAction#popups)? – Haibara Ai Apr 25 '16 at 05:46
  • https://developer.chrome.com/extensions/devtools this should help. – Learner Apr 25 '16 at 05:47
  • @HaibaraAi For normal, I mean the one with a popup.html, that displays an icon next to the address bar and you can click on it ( and then a popup appears). – AlexD Apr 25 '16 at 05:59
  • @Learner, thank you for the resource. – AlexD Apr 25 '16 at 06:00
  • @AlexD You're welcome. – Learner Apr 25 '16 at 06:02

2 Answers2

2

"Normal" extensions with popup.html are using popups, and the popups can be specified through browser action or page action.

Extensions like Observe Point are DevTools extension, they are extending devtools and add functionality to the chrome devtools.

As for "intercept a response", it has no direct relationship with what type of extension it is, as long as you declare webRequest along with host permissions in your manifest.json, you could observer, analyze, intercept, block or modify network requests in-flight as you wish.

More details you could take a look at chrome.webRequest, there are very detailed examples.

Updated: for modifying Http responses, see this thread chrome extension - modifying HTTP response for more details.

Community
  • 1
  • 1
Haibara Ai
  • 10,703
  • 2
  • 31
  • 47
  • Thank you! So you're basically saying that I can achieve my goal with both of them right? I'm going to do some research on DevTools extensions. – AlexD Apr 25 '16 at 08:04
  • I developed an extension to download file from a page and send it to a server. i used popop to access download acrtions. and i had to send messages between popup script and content script to manage. does using developer tools make it any easier and cleaner? @haibara-ai – Mostafa Nobaqi Jul 22 '23 at 18:51
0

The linked extension appears to utilize chrome.devtools.panels

guest271314
  • 1
  • 15
  • 104
  • 177
  • Thank you for the answer! I was interested more in the functional differences. What can one do that the other one can't? – AlexD Apr 25 '16 at 06:01
  • @AlexD There are several examples of `DevTools` extensions at [devtools-extensions](https://github.com/thingsinjars/devtools-extension/). Functional differences in which areas? What are you trying to achieve? – guest271314 Apr 25 '16 at 06:02
  • I have to develop an extension similar to Observe Point that intercepts some web analytics calls, then sends some info to a server and also intercepts the responses from the webserver. A work collegue told me that regular extensions (the ones with a popup) cannot intercept the response from a server, so I decided to do a little research to see if that's true. – AlexD Apr 25 '16 at 08:01
  • @AlexD, for http reponse, I believe you could only modify response header, not the response body. See http://stackoverflow.com/questions/18310484/chrome-extension-modifying-http-response – Haibara Ai Apr 25 '16 at 08:12
  • @AlexD _"and also intercepts the responses from the webserver."_ Yes, it should be possible to modify response body. See also [`ServiceWorkers`](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) – guest271314 Apr 25 '16 at 14:12