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

  • Home
  • SEARCH
  • 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 8883903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:55:55+00:00 2026-06-14T20:55:55+00:00

chrome.windows.getCurrent only gets me the background.html itself. What I really want is the content

  • 0

chrome.windows.getCurrent only gets me the background.html itself. What I really want is the content window that the user is browsing.

Any tips for this, thanks!

  • 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-14T20:55:56+00:00Added an answer on June 14, 2026 at 8:55 pm

    The current window is the window that contains the code that is currently executing. It’s important to realize that this can be different from the topmost or focused window.
    For example, say an extension creates a few tabs or windows from a single HTML file, and that the HTML file contains a call to chrome.tabs.getSelected. The current window is the window that contains the page that made the call, no matter what the topmost window is.

    If you want to get content window what user is browsing you can use following code:

    popup.js

    chrome.windows.getAll({"populate":true},function (windows){
        for(i=0;i<windows.length ;i++){
            if(windows[i].focused){
                for(j=0;j<windows[i].tabs.length;j++){
                    if(windows[i].tabs[j].selected && windows[i].tabs[j].active && windows[i].tabs[j].highlighted ){
                        console.log(JSON.stringify(windows[i].tabs[j]));
                    }
                }
            }   
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

chrome.bookmarks.create({parentId: nodeId, title: title},function(bmNode) { chrome.windows.getCurrent(function(window) { chrome.tabs.getAllInWindow(window.id, function(tabs) { for(var i=0; i<tabs.length; i++)
There's a bug in Windows Chrome that makes a radio button's background turn white
var windows = chrome.windows.getCurrent( function(windows){ try{ // dont really know why this is null.
I have a Chrome app that opens a popup window. I would like it
I know that in Chrome and FF, if window.onbeforeunload returns null, then the dialog
I'm writing a Chrome extension which dynamically changes the content of the popup window
How might I detect that a user has selected and copied some content in
I want to run multiple Google Chrome application windows logged into the same web
I have an array var array = [google,chrome,os,windows,os]; I want to delete the value
In Chrome v17.0.963.79 on Windows 7, I seem to be having an inexplicable problem

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.