LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 05-14-2023, 06:46 PM   #1
martixy
LQ Newbie
 
Registered: May 2023
Posts: 9

Rep: Reputation: 0
[Bug] Forum erases basic javascript global objects


Like the console.

You just don't mess with the window like that. It's rude.

vbulletin_global.js?v=3810b1
Code:
if (!window.console || !console.firebug) {
    window.console = {};
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
    for (var i = 0; i < names.length; ++i) {
        window.console[names[i]] = function() {}
    }
}
Somebody needs to fix that condition.
 
Old 05-19-2023, 11:45 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,226

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
As this doesn’t hinder any legitimate use of the forum, I’d close this as “not a bug”.
 
Old 05-20-2023, 09:17 AM   #3
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,604

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
Quote:
Originally Posted by dugan View Post
As this doesn’t hinder any legitimate use of the forum
It hinders quickly testing JavaScript code, which is not illegitimate, and there is zero benefit to LQ in breaking the functionality.

One example of where it is useful is verifying code when responding to JS questions in the programming forum.

There's a couple of workarounds - easiest is to disable JS for linuxquestions.org (using uBlock Origin) so the vbulletin_global.js script doesn't run, but another is to restore it with:
Code:
function restoreConsole()
{
   var i = document.createElement('iframe');
   i.style.display = 'none';
   document.body.appendChild(i);
   window.console = i.contentWindow.console;
}
 
Old 05-27-2023, 10:25 AM   #4
martixy
LQ Newbie
 
Registered: May 2023
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dugan View Post
As this doesn’t hinder any legitimate use of the forum, I’d close this as “not a bug”.
I have a medical condition and I use userscripts and extensions to increase the accessibility of various sites and make them easier to navigate. These sometimes need to be adapted or configured.
Lack of the console makes this particularly hard.

Perhaps you'd like to reconsider.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Global Objects in Javascript- Possible to Exploit? dman777 Programming 5 07-13-2012 09:17 AM
LXer: Java Data Objects and Service Data Objects in SOA LXer Syndicated Linux News 0 01-17-2009 06:10 AM
YAST erases GRUB Schalken SUSE / openSUSE 1 07-12-2007 07:17 AM
[SOLVED] [vi|man|less] covers/erases previous screen output zedmelon Linux - Software 4 01-10-2005 06:11 PM
MBR erases when power is off Zero-0-Effect Linux - General 6 01-24-2004 09:05 PM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration