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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:47:21+00:00 2026-06-14T07:47:21+00:00

I am fully aware that playing background music in a website is a horrible

  • 0

I am fully aware that playing background music in a website is a horrible idea. However, my client insists on it. We’ve had all sorts of trouble with it. First, we had to find a script to have the song “follow” the browser (it’s called “HTML5 background audio player” for those looking for such a thing), remembering where the song was cut off between page loads.

However, we now have a new problem. If the site is open in more than one tab or window at a time, the music plays over itself.

I am also fully aware that the simple solution is to just manually mute the sound if you decide to open up another page in the site in a new tab or window. I discussed this. However, my client is a very “particular” man and insists that the computer “should know when I open a new page.”

My question is: does such a thing exist? I have no idea how this would be accomplished in JavaScript.

  • 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-14T07:47:22+00:00Added an answer on June 14, 2026 at 7:47 am

    If you are talking about dynamically opening a new tab, by clicking on a link and having that click call window.open();, then .open() returns a reference to the child window, which you can then communicate with in the parent script: var childWindow = window.open(url);

    Otherwise, cookies?
    A session-parameter in the query string, which you could change if a new tab was opened.

    Another suggestion, if you’re using html5-audio exclusively, would be something like using localStorage.
    Most browsers supporting HTML5 window.Audio; also support window.localStorage;.
    You’d have to expressly check to see that localStorage is indeed supported and enabled, but that’s just good citizenship.

    Then you should be able to set a randomized ID for the tab, save that ID in session-storage, set an “is_playing” or whatever field in localStorage to the ID you gave the tab in sessionStorage…

    …and then on each new tab, check to see if “is_playing” is empty in localStorage, OR if the ID is equal to the one set in sessionStorage.

    The difference between localStorage and sessionStorage is that sessionStorage is emptied after you close the browser, and it also should not be shareable between tabs.

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

Sidebar

Related Questions

Being resonably new to using GTK+, im not fully aware of all its functionality.
I am fully aware that generic arrays cannot be instantiated like such: data =
We have a problem with deserializing an exception. I am fully aware that it's
I am fully aware that this question has been asked many times but I
I am fully aware that I am doing is: 1) Unsafe, that I have
I'm fully aware that this is the wrong way of doing it, but I'm
Disclaimer: I am fully aware that the id attribute is for unique IDs. In
Disclaimer: I'm fully aware that the best way to represent date/times is either Unix
I'm fully aware that set division can be accomplished through a series of other
I'm fully aware that this question has been asked and answered everywhere, both on

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.