Introduction to content scripts using Javascript
How to extend browser functionalities using content scripts
Hello guys and welcome to another article. In this one, I would like to cover some basic about content scripts and how we can use them to extend browser functionalities and enhance overall user experience.
What are content scripts? A content script is a part of an extension that runs in the context of a particular web page and enables developers to modify already existing pages. Let say for example that you want to change a particular part of a web page. How would you go about it? Just to experiment a bit, we can go into developer tools and try our stuff there.
Head to http://example.com/ and open developer tools.
Suppose that we want to modify the h1 tag at the top (Example Domain) to Modified Example Domain. What we can do is first search for the html element and change its inner html. Here are the commands to do so.