A
A
Artyom Zubkov2011-10-31 12:27:54
JavaScript
Artyom Zubkov, 2011-10-31 12:27:54

How to use Chrome API to find out where the request is sent?

I basically understand that it is necessary to hang up the listener on any event.

I found in the experimental API , in principle, what I need , but

chrome.experimental.webRequest can only be used in extension processes
I can’t hang it on a specific page, but I don’t know how to listen to all requests from the extension.

My task is to catch a request for a video file and offer to save it with an external download manager.

Point in the right direction please.

UPD :
Thank you all for your attention! I figured it out!
You never know who will need it, but keep in mind this will only work with the experimental extensions API
option enabled In manifest.json:
{
   ...
   permissions: [
         "experimental",
         "http://*/*", "https://*/*", "ftp://*/*", "file:///*/*" ],
   ...
}

In background.html or in a script for it:
chrome.experimental.webRequest.onBeforeRequest.addListener(
	function(details) {
		console.log(details.url);				
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question