S
S
SKEPTIC2020-01-12 11:23:58
Opera
SKEPTIC, 2020-01-12 11:23:58

How to write an extension so that it changes the JS code on the site?

There is a site. There are a lot of pop-ups. I wrote an extension for opera. In the code, when you click on the extension icon, I wrote the JS code that removes these windows. But it doesn't work. I decided to write alert(window.location) in the code.
It shows me that I'm on some kind of "background_page" although I'm on another site.
What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2020-01-12
@pro100chel

You are executing your code in the wrong place
https://developer.chrome.com/extensions/content_scripts
UPD: https://dev.opera.com/extensions/content-scripts/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question