D
D
Dmitriy2232021-12-09 06:40:14
JavaScript
Dmitriy223, 2021-12-09 06:40:14

Google extension how to run video in frame?

I am writing a Google extension, I have an embedded YouTube video on my site, the extension should click on it and start the video. The click itself is simple, getElementsByClassName("play button")[0].click()
The video starts, but it immediately stops, how to solve the problem? In the manifest, I specified access to all_frame

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2021-12-09
@zkrvndm

Everything works:

document.querySelector('button[aria-label="Смотреть"]').click();

And if something doesn't work for you, show how it doesn't work. At least lay out the extension manifest and the code from the content script, as much as possible prepare a test page with a pre-built frame and post a link to this page here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question