Skip to content
Advertisement

How to get YouTube URL in background?

For my school project, I need to extract Video URL from Youtube from a Chrome extension. It means I should play a video on Youtube and I need the URL of that video displayed in my chrome extension body.
How should I get this video URL using Javascript?

Advertisement

Answer

window.location.href if you are on the page playing a video.

Advertisement