Skip to content

Tag: google-chrome-extension

Chrome extension getSelection not working

I am trying to create a chrome extension which only consist of a button. When this button is clicked, it should make an alert box which contains the highlighted textarea on a page. I can’t get it to work. I can make it alert a hardcoded string, but not make it alert some highlighted text / selected text…

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? Answer window.location.href if you are on the page playin…