Answer the question
In order to leave comments, you need to log in
How to access DOM through extension and hide some element?
Good afternoon.
Learn how to make extensions for Google Chrome.
I decided to try to do something similar to AdBlock.
Let's say I get the URL of the current site in the active tab
chrome.tabs.query({active:true},function(tabsArray) {
var tab = tabsArray[0];
var tabUrl = tab.url;
//var el = document.getElementById('url');
//el.innerText = tabUrl;
//console.log(tabUrl);
var e = document.getElementById('theme-header').style.display = 'none';
})
Answer the question
In order to leave comments, you need to log in
Content scripts are files that run in the context of web pages. By using the standard Document Object Model (DOM) , they are able to read details of the web pages the browser visits, make changes to them and pass information to their parent extension.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question