R
R
rimlin2017-08-28 18:39:47
JavaScript
rimlin, 2017-08-28 18:39:47

How to auto-pause music when turning on music in another browser tab?

I noticed that VK Music automatically pauses the playing music if you turn on the video on youtube. Does anyone know how it works?
And I noticed that it works in Chrome, it does not work in Firefox

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Shashenkov, 2017-08-28
@teknik2008

localStorage and write events to it.
This allows you to forward messages to other tabs.

A
Andrey Shedko, 2017-09-07
@Mamboking

Or EventEmitter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question