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 6929543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:19:53+00:00 2026-05-27T11:19:53+00:00

var windows = chrome.windows.getCurrent( function(windows){ try{ // dont really know why this is null.

  • 0
var windows = chrome.windows.getCurrent(
    function(windows){
        try{
            // dont really know why this is null. it should be a list of tabs.
            if(windows.tabs == null) 
        alert(windows.type + " " + windows.id);
        }
        catch(e){
            alert(e);
        }
    });

I am using this code to get all the open tabs in the current window. But the window.tabs is always null even though there are tabs open in the current window. Is there something wrong with the concept of current window.
Could anyone please explain what is it that i am doing wrong.
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-05-27T11:19:54+00:00Added an answer on May 27, 2026 at 11:19 am

    Looks like the windows object that gets passed to your callback doesn’t have a tabs field. Try this code instead:

    chrome.windows.getCurrent(function(win)
    {
        chrome.tabs.getAllInWindow(win.id, function(tabs)
        {
            // Should output an array of tab objects to your dev console.
            console.debug(tabs);
        });
    });
    

    Also ensure that you have the tabs permission. I also ran this on a background page, so if you’re not running it on a background page, you should make sure chrome.tabs is available in your context.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example: (function() { var proxied = window.eval; window.eval = function() { return proxied.apply(this,
windows.onload=function(){ ...somecode... var scene = new THREE.Scene(); ...somecode... var i; var j; for (i=......){...}
The code im currently using is this var focus; function focuswindow() { focus =
$(document).ready(function(){ $('.choices a img').click(function(e) { var url = $(this).attr('href') + ' .con_cen2'; $('.con_cen').html('loading...').load('signup.html'); e.preventDefault();
I found this file at google code with the function: function SetAlwaysOnTop() { var
I am working on a Chrome extension, where in my JavaScript function should identify
I have this JS code: var recipesPost = function(name, ingredients, steps) { $.post('/api/recipes', {
this.fillSelectBox = function (flowCounterObj) { while (this.selectBox.hasChildNodes()) { this.selectBox.removeChild(this.selectBox.firstChild); } var line = 0;
The following function works in IE but not in Chrome: function doStuff() { var
I have an array var array = [google,chrome,os,windows,os]; I want to delete the value

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.