Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9233641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:36:11+00:00 2026-06-18T06:36:11+00:00

I have wrote chome extension, that processing all requests in the browser: manifest.json: {

  • 0

I have wrote chome extension, that processing all requests in the browser:

manifest.json:

{
  "name": "MyExtension",
  "version": "0.1",
  "description": "All requests are under control!",
   "permissions": [
        "tabs",
        "webRequest",
        "http://*/*"
  ],
  "background": {
    "scripts": ["background.js"]
  },

  "manifest_version": 2
}

background.js:

chrome.webRequest.onCompleted.addListener(
  function(details) {
  console.log(details);
  console.log(chrome.tabs.getCurrent());

  },
   {urls: ["http://*/*"],
   types: ["image"]});

But now, I want to know, which page (tab?) has created this request?

for example:

Request 1 - generated by google.com page,
Request 2 - generated by stackoverflow.com.

How can I solve this task?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:36:12+00:00Added an answer on June 18, 2026 at 6:36 am

    The following code will fetch tab\page details Who has generated Web Request.

    onCompleted Listener has a tabId property which identifies tab, and you can retrieve all details of the tab.

    chrome.webRequest.onCompleted.addListener(
    
    function (details) {
        chrome.tabs.get(details.tabId, function (tab) {
            console.log("This  " + JSON.stringify(details) + " Web request is from this " + tab.id + " tab and its details are" + JSON.stringify(tab));
        });
    }, {
        urls: ["http://*/*"],
        types: ["image"]
    });
    

    Sample Output

    This  {"frameId":0,"fromCache":true,"ip":"74.125.236.63","method":"GET","parentFrameId":-1,"requestId":"563","statusCode":200,"statusLine":"HTTP/1.1 200 OK","tabId":64,"timeStamp":1359389270317.956,"type":"image","url":"http://www.google.co.in/images/srpr/logo3w.png"} Web request is from this 64 tab and its details are{"active":true,"highlighted":true,"id":64,"incognito":false,"index":4,"pinned":false,"selected":true,"status":"loading","title":"Google","url":"http://www.google.co.in/","windowId":1} 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have wrote a script that was run from a spreadsheet. I had One
I have wrote an application that syncs two folders together. The problem with the
I have wrote a plugin for facebook that sends data to testing-fb.local . The
I have a Chrome extension that injects an iframe from foo.com into bar.com. So,
I have written a Chrome extension that adds a char counter to some input
I have hit a problem with the Perfarce extension that I can’t seem to
I have wrote a script to detect when I reach the div element which
I have wrote a method to convert any layout Liner,Relative,Frame etc into Bitmap but
I have wrote some code to find out of 3 variables witch is the
I have wrote a custom MultipleChoiceField. I have everything working ok but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.