2

I am trying to make a grease monkey script (well, tamper monkey actually) for Google Chrome to remove ads, suggestions, columns, and such on Facebook. I was able to modify some user scripts I found online to remove Facebook's Ads, and the right and left columns, but the thing I can not make leave, and is driving me crazy is the little gray lines on the edges and in between posts. Originally they were fine, but with the columns gone, they are kind of just floating randomly, particularly the right one. to remove it, I tried to use:

document.getElementById('mainContent').removeattribute('border-right');

It didn't work, neither did several hours worth of other things I tried. I went into Chrome, hit F12, and checked the resources page and found the stylesheet with the attribute in it, and it reads:

.hasLeftCol #mainContainer{border-right:1px solid #ccc;min-height:600px}

I can not make them go away, and I would appreciate assistance from anyone who can, thank you.

4

1 回答 1

4

border-right是样式属性,而不是元素属性,因此removeAttribute不起作用。而是试试这个:

document.getElementById("mainContainer").style.borderRight = "none";

(请注意,这border-right适用borderRight于 JavaScript,并确保您准确拼写名称。)

但是,您可能更喜欢用户样式表。诸如Stylish之类的浏览器扩展允许您编写自动应用的 CSS,而不是通过脚本。(您可以使用 隐藏内容display: none,或使用 静音opacity: 0.5。)

于 2013-09-14T04:19:29.070 回答