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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:29:26+00:00 2026-06-02T16:29:26+00:00

I am trying to create a chrome extension – when an user clicks on

  • 0

I am trying to create a chrome extension – when an user clicks on a icon, the popup window with the form appears. The textarea in the form can contain more parameters which comes to URL. After filling in and clicking the GO button, multiple tabs with URLs with this parameters needs to be opened.

Example: popup.html

<form name="myform">`
<textarea id="params" name="params" style="width: 170px;height: 270px;"></textarea>`
<input id="edit" checked="checked" type="radio" name="edit" value="1" /> option 1 <input id="edit" type="radio" name="edit" value="2" /> option 2`
<div id="clicked">GO</div>`
</form>`

Then in popup.js I have:

function click(e) {
    chrome.tabs.executeScript(null, {
        code: "alert('starting');"
    });

    opener();
}

document.addEventListener('DOMContentLoaded', function () {
    var divs = document.getElementById("red");

    divs.addEventListener('click', click);

});

So when an user clicks on GO button, the opener() function needs to be started.

Here is the opener function – it only determines the values of textarea and radio buttons and opens as many new tabs as manz parameters are in the textarea.

function opener() {
    alert('working');
    var parameter = document.myform.getElementById("params").value;
    for (index = 0; index < document.myform.edit.length; index++) {
        if (document.myform.edit[index].checked) {
            var radioValue = document.myform.edit[index].value;
            break;
        }

        var Result = parameter.split("\n");

        if (radioValue == 1) {
            for (i = 0; i < Result.length; i++) {
                window.open('http://mypage.com?param=' + Result[i]);
            }
        }
    }
}

So the Result is the value of textarea splitted by \n and radio value is the value of radio button selected.

This works fine – after clicking a browser icon the popup with form comes up, but when I fill in the textarea and select the first radiobutton, then I click GO, the opener funvtion works not…

The only thing that works is the popup alert with working word and then the alert starting from the click(e) function.

So the opener function starts, writes the alert, but nothing else… no tabs will open, nothing happens…

Can someone help me please?

  • 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-02T16:29:28+00:00Added an answer on June 2, 2026 at 4:29 pm

    I’ve found that using the chrome.tabs.create function works much better within the extension than the window.open function does.

    chrome.tabs.create({url:"https://www.facebook.com/PSChrome"});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a simple google chrome extension which can convert selected
I am trying to create a chrome extension using HTML5 WebSockets and can't get
I am trying to create a Google Chrome extension where a user would highlight
I am trying to create Google Chrome extension that will send interesting links to
I'm trying to create a chrome extension which scans a local directory for new
So I am trying to create an extension in Chrome (a prototype for a
I'm trying to create an extension using this docs: http://code.google.com/chrome/extensions/content_scripts.html I want a part
I'm trying to create a chrome extension and im doing this by parsing an
I am writing a Chrome extension where I am trying to create a GUI
I am very new on Chrome extension development. I am trying to create an

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.