Firefox is displaying Javascript source code instead of ads
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Distribution: openSUSE, Raspbian, Slackware. Older: Coherent, MacOS, Red Hat, Big Iron IXs: AIX, Solaris, Tru64
Posts: 2,317
Rep:
Firefox is displaying Javascript source code instead of ads
I should probably be thankful, right?
First, the background: I'm currently on Firefox 50.0.2 (running on OpenSUSE if that matters). Plugins: Shockwave Flash 11.2.202.491, AdBlock Plus 2.8.2, Flashblock 1.5.20, NoScript 2.9.5.2.
What I'm seeing: some sites that contain Javascript doodads (technical term) wind up not displaying or implementing what the script was intended to be doing. Instead FF is displaying the "raw" Javascript. I can't tell if it's clobbering functionality of those sites or not. I don't see the problem on all sites. I'm guessing that whatever is causing this to happen may be due to some aspect of Javascript (I'm not a Javascript coder, BTW) that doesn't work with FF's interpreter. I do not see major problems with the sites where I'm seeing source code in lieu of whatever the script was supposed to be doing. Menus seem to work, navigation appears to work, etc.
I've tried visiting the sites where I'm seeing the problem using the usual alternative browsers -- like Opera, Konqueror, Chrome, etc. -- and have not noticed the problem when viewing with those browsers. Just with Firefox.
The update to 50.0.2 came about a week ago. I'm fairly sure that the problem began before that, though. Prior to 50.0.2, I'd been running FF 49.0.1 since 10/08. What I have no idea about is whether the web sites have done any revamps to part (or parts) of their sites that could be causing this.
Pick one of the sites that causes the problem. Disable all the plugins you mention and try it again. If the problem disappears, add the plugins one by one, testing each time. I suspect one of the plugins is causing the problem, or the interaction between two or more of them.
Distribution: openSUSE, Raspbian, Slackware. Older: Coherent, MacOS, Red Hat, Big Iron IXs: AIX, Solaris, Tru64
Posts: 2,317
Original Poster
Rep:
Quote:
... I suspect one of the plugins is causing the problem, or the interaction between two or more of them.
NoScript seems to trigger the problem. That was totally unexpected though it seems to work if I set everything back to defaults. I did re-enable "temporarily allow top-level sites by default" and haven't encountered any ill effects yet. This was set before, though, so there's likely either another setting that caused the script display or some conflict between NoScript (and one of its settings) and another of the previously loaded plugins. I've currently only re-enabled AdBlock Plus and Noscript. I'll test that combination for a while and see if I can get by with those. Testing all the possible combinations of plugins and their settings is probably not too practical.
Distribution: openSUSE, Raspbian, Slackware. Older: Coherent, MacOS, Red Hat, Big Iron IXs: AIX, Solaris, Tru64
Posts: 2,317
Original Poster
Rep:
Quote:
I've currently only re-enabled AdBlock Plus and Noscript. I'll test that combination for a while and see if I can get by with those.
Hmm... most sites were still working nicely until I encountered one that refused to follow menu items. After clicking on "Temporarily allow all this page" -- which, annoyingly, caused many tabs to reload -- the problem of displaying Javascript source code returned. Working theory: There's some Javascript library floating around that's gotten used my some web developers that is broken in some odd way. Still debugging this one --- not full-time, though -- but I think I mentioned somewhere up above that I'm not a JS developer. The best I ever expect to get out of any debugging is to narrow down the chunk of JS that is getting pulled in just before the problem returns. We'll see...
I'm not sure what the issue is here. That is the function of NoScript. It is intended to block java from running in websites. When you click on "Temporarily Allow All This Page" and the tabs reload that's because it's changing the setting across open tabs, it's also a setting in NoScript that you can change to only reload the current tab.
Distribution: openSUSE, Raspbian, Slackware. Older: Coherent, MacOS, Red Hat, Big Iron IXs: AIX, Solaris, Tru64
Posts: 2,317
Original Poster
Rep:
Quote:
I'm not sure what the issue is here.
The issue is that enabling Javascript shouldn't cause the Javascript source code from being displayed in lieu of what the heck it was supposed to be doing.
Quote:
When you click on "Temporarily Allow All This Page" and the tabs reload that's because it's changing the setting across open tabs, it's also a setting in NoScript that you can change to only reload the current tab.
So I have to manually enable an option to use the proper definition of "This Page"? As Wolfgang Pauli once said:
``This is not right... This is not even wrong!''
Maybe I should unload NoScript altogether and take my chances. It's been more than once that the entire FF browser has gone down taking multiple windows and tabs with it and the first thing that comes up when FF is restarted is the "Welcome to the new version of NoScript" page.
Ohhhh so you were having the issue of them not displaying properly after you selected to temporarily allow them?
And I don't think I was very clear, it's not allowing temporarily on the other pages as well, but it just refreshes its current information. I'm not exactly sure why it reloads all pages by default, but you can turn that off.
Also, you have a number of plugins that are all trying to do the same thing. Adblock, NoScript, and flashblock
I would consider uninstalling one or two and see what happens. I'm currently using only NoScript on firefox and am not having any issues. But I'm on 45.5.1
Distribution: openSUSE, Raspbian, Slackware. Older: Coherent, MacOS, Red Hat, Big Iron IXs: AIX, Solaris, Tru64
Posts: 2,317
Original Poster
Rep:
Quote:
Ohhhh so you were having the issue of them not displaying properly after you selected to temporarily allow them?
Yes. Some pages appear to load/display correctly but then you find that menu items don't work until you allow some more Javascript to load -- sometimes it might take several clicks of that "Temporarily allow..." button until everything works. (Major pet peeve that is.) As I mentioned above, though. It's not universal. Some pages never cause the code display. Some only after I allow a little more Javascript to load.
Quote:
I'm not exactly sure why it reloads all pages by default, but you can turn that off.
NoScript really ought to either change that button "name" or make "this page only" the default. Just my US$0.02. (I normally have a ton of tabs open and it can be a real performance hit when a bunch of tabs start loading more code.)
As part of my initial debugging, I'd gone back to using only AdBlock and NoScript with NoScript set back to factory defaults (though I re-enabled "Allow top-level sites"). The option you're thinking of is not on by default.
Quote:
Also, you have a number of plugins that are all trying to do the same thing. Adblock, NoScript, and flashblock
I've currently got NoScript disabled and enabled Flashblock. So far so good. No annoying code dumps on web pages for the better part of a day. And -- added plus -- FF seems a little peppier. I was tired of monitoring FF in top/htop so I tweaked my KDE FF icon command line to run it in via 'nice'. Now FF CPU use shows up as 'red' in my Gkrellm CPU monitor. Before turning off NOScript there be a sea of red in that monitor and occasional stretches where the CPU was pegged with FF activity. Now? Barely any. I'm still watching things, though.
Also, I was under the impression that AdBlock and NoScript [i]might[\i] have some overlap but were intended to address different browser annoyances.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.