chrome.webRequest.onCompleted not Found in Content Script

3,960 views
Skip to first unread message

Georgel

unread,
Oct 7, 2013, 3:46:05 AM10/7/13
to chromium-...@chromium.org
hello ,
I am creating a chrome extension and I want to monitor current requests in a web page(especially images) .
When I use   chrome.webRequest.onCompleted.addListener(function(details) on the backgroud page it works fine,however when i use the content script to insert in in the current webpage nothing happens, console log shows : Uncaught TypeError: Cannot read property 'onCompleted' of undefined .
It seems I cannot use the webRequest API within the content script? If so,is there a workaroud using javascript to monitor the requests for a webpage ?(After the monitor i need to remove some images from the webpage ,that is why I need to use the Content Script)
Thank you.

Sean Anderson

unread,
Oct 7, 2013, 10:17:02 AM10/7/13
to chromium-...@chromium.org
Hey,

I'm not so sure this is possible.

According to the documentation: http://developer.chrome.com/extensions/content_scripts.html

However, content scripts have some limitations. They cannot:

Scott Fujan

unread,
Oct 7, 2013, 10:27:13 AM10/7/13
to Sean Anderson, Chromium-extensions

Correct, content scripts cannot access webRequest. But the docs are wrong; they can also access runtime and storage.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/18f846dc-a5e4-42df-8546-dd418dd42be3%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.

Georgel

unread,
Oct 8, 2013, 3:05:53 AM10/8/13
to chromium-...@chromium.org
Hello Thank you for your answers .
I may have another question : How can I communicate from the background page of a chrome extension to the Content script of another page ?

Sean Anderson

unread,
Oct 8, 2013, 3:08:09 AM10/8/13
to Georgel, chromium-...@chromium.org
Read through this, it should cover everything you're interested in: http://developer.chrome.com/extensions/messaging.html


On Tue, Oct 8, 2013 at 12:05 AM, Georgel <marian...@gmail.com> wrote:
Hello Thank you for your answers .
I may have another question : How can I communicate from the background page of a chrome extension to the Content script of another page ?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Gabriel Benisty

unread,
Oct 9, 2013, 8:02:24 AM10/9/13
to chromium-...@chromium.org
Hi All we are looking for C++ developers (free lance) with experience in Chrome Browser development to develop a private label browser 
Reply all
Reply to author
Forward
0 new messages