Google chrome chrome扩展删除facebook上的div
我是chrome扩展的新手! 我需要帮助为facebook上的模拟人生社交网站创建我的个人扩展 我不想删除正确的专栏和一些广告与我的扩展 manifest.jsonGoogle chrome chrome扩展删除facebook上的div,google-chrome,google-chrome-extension,Google Chrome,Google Chrome Extension,我是chrome扩展的新手! 我需要帮助为facebook上的模拟人生社交网站创建我的个人扩展 我不想删除正确的专栏和一些广告与我的扩展 manifest.json { "name":"The Sims Social noAds", "version":"1.0", "manifest_version": 2, "description":"Rimuovere tutto quello che non serve dalla pagina del gioco The sims Soc
{
"name":"The Sims Social noAds",
"version":"1.0",
"manifest_version": 2,
"description":"Rimuovere tutto quello che non serve dalla pagina del gioco The sims Social",
"content_scripts":[{
"matches":["http://apps.facebook.com/thesimssocial/*"],
"js":["script.js"]
}]}
script.js
document.querySelector('div.rightCol').style.display = 'none';
有人能帮我!??!?TNX rightCol是div的id,而不是类名。因此,您应该使用document.querySelector('#rightCol')
有关选择器的语法,请使用谷歌css选择器或查看。您还可以右键单击目标元素并选择Inspect element,您将在下面看到这些选择器。
现在,我将不删除没有id的div,而是使用类似于……的类。。。。。。。。如何?TNX
document.querySelector(“#rightCol”).remove()
?