user1853129
user1853129

Reputation: 9

chrome extension to remove div on facebook

i'm new on chrome extensions! i need help to create my personal extension for the sims social on facebook!!

I won't to remove the right column and some ads with my extension!!

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   Social",
"content_scripts":[{
"matches":["http://apps.facebook.com/thesimssocial/*"],
"js":["script.js"]
}]}

script.js

document.querySelector('div.rightCol').style.display = 'none';

Someone can help me!??!? TNX!!

Upvotes: 0

Views: 545

Answers (1)

方 觉
方 觉

Reputation: 4162

rightCol is the id of the div instead of the class name. Therefore, you should use document.querySelector('#rightCol') instead.

For the syntax of the selectors, Google css selectors or take a look at http://www.w3schools.com/cssref/css_selectors.asp . You can also right-click the target element and choose Inspect Element, and you'll see those selectors below. enter image description here

Upvotes: 2

Related Questions