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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:36:38+00:00 2026-06-05T15:36:38+00:00

I am new to writing extensions for Chrome. I am trying to write a

  • 0

I am new to writing extensions for Chrome. I am trying to write a simple extension that will open a new tab with the specified url, on a click of the extension icon and need to pass a value to it so that this value is filled in the input area (ex: input for search) of the specified url.

I am successful in opening the new tab with the given url on clicking the icon. I used background script to listen for the event on the icon and open a tab, the script is as follows:

chrome.browserAction.onClicked.addListener(function(tab) {

  chrome.tabs.create({'url': 'www.google.com'}, function(tab1) {
    // Tab opened.
  });
});

Now I am confused about what method will allow me to send some values to the new tab and use the value and perform some operation there like, if I pass “java api” I have to put this in the search area of the google page. I tried looking the Chrome extension docs but it is confusing as to what to use?

  • 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-05T15:36:40+00:00Added an answer on June 5, 2026 at 3:36 pm

    You should use chrome.tabs.executeScript() to run a content script in this tab:

    chrome.tabs.create(..., function(tab1) {
      chrome.tabs.executeScript(tab1.id, {file: ...});
    });
    

    This content script will then be able to do something with the tab contents. If it needs some data from your extension it will have to send a message.

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

Sidebar

Related Questions

I am very new (started today) to writing chrome extensions but need to write
I'm writing a Chrome browser extension that takes a snapshot of the current tab's
I'm pretty new to writing Chrome extensions. I've noticed that all of the extensions
I'm writing a google chrome extension that uses chrome.pageCapture.saveAsMHTML(object details, function callback) function callback
I am writing an extension for Google Chrome. The content script never sees that
I am writing a Chrome extension that synchronizes with Opera Link, but I keep
I'm writing a new tab extension for Firefox, and I'd like to have a
I am currently writing a chrome extension so that I have a button on
I am new to writing use cases.I heard that Use cases are non-technical expressions
I am fairly new to writing code, but I played around with some chrome

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.