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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:18:14+00:00 2026-05-25T17:18:14+00:00

I am working on the following code for a chrome extension. Basically I want

  • 0

I am working on the following code for a chrome extension. Basically I want it to check the page that initially loads and if it matches my website st.mywebsite.com it will execute the code. Right now it doesn’t check and will execute any pages that loads. I am trying to get it to load http://st.mywebsite.com/?q= plus the terms in the array. So every X number of seconds/minutes it will load a new term in the array and add it to the url http://st.mywebsite.com/?q=can anyone help?

if((window.location.hostname != "st.mywebsite.com")){
    window.onload = function() {
        terms = new Array("5d65sd", "95sd4s", "h2j4g8h", "c87e2dd", "e6e5f2g4", "3m5g5gv");

        min = 1;//minimum
        max = 60;//maximum
        randomnumber = Math.floor(Math.random() * (max - min + 1)) + min;

        var seconds = randomnumber;
        var timer;

        function countdown() {
          var container = document.getElementById('right');
          seconds--;
          if(seconds > 0) {
            container.innerHTML = '<p>Please wait <b>'+seconds+'</b> seconds.</p>';
          } else {
            window.location = 'http://st.mywebsite.com/?q='+terms;
          }
        }

        timer = setInterval(countdown, 1000);
    }
}
  • 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-25T17:18:15+00:00Added an answer on May 25, 2026 at 5:18 pm

    At the line you have window.location, change it to window.location.href

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

Sidebar

Related Questions

Why is the following code (in cocoa) not working? NSString *extension = [fileName pathExtension];
I'm working on a Google Chrome extension. In the popup I have the following
I am using following code to show video on my website. It is working
I want to trigger the click, to which following code is listening: chrome.browserAction.onClicked.addListener(function(tab) {});
I am working on the following page. http://www.ranger.ryerson.ca/library/test/steveDev/testcarousel/test.html it works in firefox, chrome, and
Using Dojo verions 1.3.2. The following code is working fine in FF and Chrome,
I'm working on a Google Chrome extension that provides import/export functionality and I ran
I have the latest Chrome, I'm building an extension. Consider the following code: var
I'm working on a small Chrome extension that will call the Remember the Milk
Following code is working with Firefox browser but onClick is not working with 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.