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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:59:33+00:00 2026-06-13T21:59:33+00:00

This function has a callback like function(array of any result) {…}; But I don’t

  • 0

This function has a callback like function(array of any result) {...};

But I don’t know what is the result means.

For example,

chrome.tabs..executeScript(null,
   {code:"var x = 10"},
   function(){});

how to return the x to the callback?

  • 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-13T21:59:34+00:00Added an answer on June 13, 2026 at 9:59 pm

    The result of a script is the last expression being evaluated. So in your example you could use:

    chrome.tabs.executeScript( null, {code:"var x = 10; x"},
       function(results){ console.log(results); } );
    

    This will log [10] to the extension’s console.

    results is actually an array of values because if the page has more than one frame you can specify that the script should be injected in each one of them and get the result of all injections. See the specification for executeScript. If you don’t specify allFrames: true, then results will always be a single element array.

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

Sidebar

Related Questions

I have some third-party Javascript that has statements like this: FOO = function() {
Does this function has the same behavior that memset ? inline void SetZeroArray( void
I'm reading code from GraphServer . And there is this function that has weird
I have a bash script that has this function in it: function start_vi() {
I've got a .js file that has this function in it: function showDialog(divID) {
An exportable function has a struct as a one of the parameters. This DLL
So I wrote this function that is given possible numbers, and it has to
this code produces 17 error C2995: function template has already been defined; there was
The Entity Framework has a function with this signature: public EntityTypeConfiguration<TEntityType> HasKey<TKey>(Expression<Func<TEntityType, TKey>> keyExpression);
I have a function B that has this declaration: public void B(Class<? extends C>

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.