Hi,
I've been using NS for a while without problem but can't seem to figure out why I've just encountered the following problem. I was just visiting the website for http://www.bothwellcheese.com/about-us/ ... lades.html and by having NS running and blocking scripts it seems to have allowed a few lines of spam to be injected into the page. When scripts are allowed for the page the injected code disappears and the page displays normally. Obviously I'm a novice user and can't seem to figure out if this is a problem on my end or something with their website. The problem also occurs on several other of their pages. Thanks for the help.
Issue with code injection when using NS
Issue with code injection when using NS
Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0
Re: Issue with code injection when using NS
The "problem" is on their end. Nothing is being "injected" into the page. That spam is being hidden by a script which is why it goes away with scripts allowed. I have no idea why they would do that however 

*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21
Re: Issue with code injection when using NS
Thanks barbaz. I just wasn't sure if it was a vulnerability on my system that was allowing code to be injected into webpages or something there. And were you asking why they'd use a script to hide the problem rather than solve it?
Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0
Re: Issue with code injection when using NS
No question intended, I was just trying to say that the whole thing seems really odd and implying that you should be extra careful about what scripts you allow on that site. Thenamslew wrote:were you asking why they'd use a script to hide the problem rather than solve it?

*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21
Re: Issue with code injection when using NS
Ahh gotcha. I was rather confused by it also, hence why I asked about it. Again, thanks for your help and for taking the time to answer my question. 

Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0
Re: Issue with code injection when using NS

The ID of the ad element doesn't seem to change, so you could try using a surrogate script to run the ad-hiding code.
In about:config, add a new string value 'noscript.surrogate.bothwell.sources' set to
Code: Select all
!www.bothwellcheese.com
Code: Select all
if(document.getElementById('bjyhplkvj') != null){document.getElementById('bjyhplkvj').style.display = 'none'; document.getElementById('bjyhplkvj').style.width = '0px'; document.getElementById('bjyhplkvj').style.height = '0px';}
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.
True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.
True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0
Re: Issue with code injection when using NS
OK, so it looks like the ID does change after all, and it is different on different pages.
But thus far, it has always been a string of 9 lowercase letters.
Try putting this in 'noscript.surrogate.bothwell.replacement':
That seems to catch the spam, and thus far I haven't noticed it breaking anything.
But thus far, it has always been a string of 9 lowercase letters.
Try putting this in 'noscript.surrogate.bothwell.replacement':
Code: Select all
var divs = document.getElementsByTagName('div'); for (var i = 0; i < divs.length; i++) { if (/^[a-z]9$/.test(divs[i].id)) { divs[i].style.display = 'none'; divs[i].style.width = '0px'; divs[i].style.height = '0px'; } }
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.
True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.
True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0