Closed Bug 1352508 Opened 7 years ago Closed 6 years ago

Disable Console logging by Websites

Categories

(DevTools :: Console, enhancement)

53 Branch
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: eros_uk, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170307064827

Steps to reproduce:

Increasingly, websites write codes that outputs debugging to console. 

IMO, websites should not be allowed to log to user console. Failing that, a preference to enable/disable this feature would be advantageous.

As a developer, every time that I open the console. I find it full of debugging messages from websites.

facebook is a prime example with their warning

"


                                            
 .d8888b.  888                       888    
d88P  Y88b 888                       888    
Y88b.      888                       888    This is a browser feature intended for 
 "Y888b.   888888  .d88b.  88888b.   888    developers. If someone told you to copy-paste 
    "Y88b. 888    d88""88b 888 "88b  888    something here to enable a Facebook feature 
      "888 888    888  888 888  888  Y8P    or "hack" someone's account, it is a 
Y88b  d88P Y88b.  Y88..88P 888 d88P         scam and will give them access to your 
 "Y8888P"   "Y888  "Y88P"  88888P"   888    Facebook account.
                           888              
                           888              
                           888              

See https://www.facebook.com/selfxss for more information.
"
Severity: normal → enhancement
Component: Untriaged → Developer Tools: Console
Product: Firefox → DevTools
Hello erosman, sorry about the delay. This feature works as intended, for developers to log diagnostics and other informative messages to the console.

Also, no content is rendered while the console is not open, if performance is bothering you.

You can delete existing content by using the "rubbish bin" button on the left hand side.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Just as a finale note .....

Console logging is a great feature for the developers to log diagnostics and other informative messages to the 'their own' console.

Logging them to users' console is a different issue. Logs by a website to visiting users' browser console provides little benefit to the user.
(In reply to erosman from comment #2)
> Just as a finale note .....
> 
> Console logging is a great feature for the developers to log diagnostics and
> other informative messages to the 'their own' console.
> 
> Logging them to users' console is a different issue. Logs by a website to
> visiting users' browser console provides little benefit to the user.

Hello erosman,

I don't understand why you differentiate developers console from users one ?
I mean, the users of the console are indeed developers; end users of a page are not supposed to open it.
So the console displays log messages, which is what it's supposed to do.

And according to me, the example of facebook is a very legitimate use of the console so non-tech people are not tricked by someone else who could get personal information (we also have this kind of protection on our end).

I wonder what's your use of the console in a page that you are not developing ? I guess executing some JS/manipulating the page ?

If you just want to execute some snippets into the page and not be bothered by logs, you have 2 options: 
- use scratchpad
- disable all the filters in the console: you will still be able to execute snippets and get the result of it.
Hello Nicholas

I think the main point of the bug might have been understood.
It did not indicate that the console is not working as intended.

The request was to allow a user preference to disable output to the console by websites.

There was a time that add-on that outputted excessive amount of debugging to the console, where rejected. Console log should be used to debug and debug must be performed by the respective developer. It was a requirement to remove functions that are used purely for debugging in production add-ons.

Nowadays, add-on are allowed to log indiscriminately to the console. There are numerous add-ons that log "starting this..." " loaded.." and other messages which are only beneficial to the specific developer at the time of development.

Websites have joined the club and regularly spam console log because developers don't think removing the debugging processing is necessary before releasing and utilising a code.

I imagine, the irrelevant logging would add to the resource usage of the page, as well as making it more cumbersome for other developers to work. I am familiar with the filter process but we are discussing the principle.

Therefore, I suggested an option to be able to disable console logging by websites.

The Facebook example, didn't start as above and it had a different context before (something like.. what are you doing here, you shouldn't be here... if I recall correctly).

There are far too many developers who log indiscriminately to the console ie:

let x = 2;
console.log(x);

x += 5;
console.log(x);

x *= 3;
console.log(x);

BTW, we are talking about normal string messages outputted to the console and not error messages.
That was the reason behind it. :)
okay, thanks for your inputs, it makes more sense now.
A filter to switch domains on and off makes a lot of sense. Have you found specific external dependencies that are especially noisy?


We also have plans to reduce the overhead of extension logging, while making them available to extension developers that need them.
> We also have plans to reduce the overhead of extension logging
The issue here is console. spamming by web-sites not extension developers.


Here are some more example of console.log spamming


Advertising spam?!
Chat~Gifts~ProductionClient~Reddit.7b5296f32bde5e0b77a1.js:1:51693


                  ,d"=≥,.,qOp,
                 ,7'  ''²$(  )
                ,7'      '?q$7'
             ..,$$,.
   ,.  .,,--***²""²***--,,.  .,
 ²   ,p²''              ''²q,   ²
:  ,7'                      '7,  :
 ' $      ,db,      ,db,      $ '
  '$      ²$$²      ²$$²      $'    Using Reddit at work? Work for Reddit.
  '$                          $'        https://www.reddit.com/jobs
   '$.     .,        ,.     .$'
    'b,     '²«»«»«»²'     ,d'
     '²?bn,,          ,,nd?²'
       ,7$ ''²²²²²²²²'' $7,
     ,² ²$              $² ²,
     $  :$              $:  $
     $   $              $   $
     'b  q:            :p  d'
      '²«?$.          .$?»²'
         'b            d'
       ,²²'?,.      .,?'²²,
      ²==--≥²²==--==²²≤--==²


Starting Raven release 9cee7053-production public url https://6b5ce051b2ed4032bd906af3de0630cd@oops.redditmedia.com/11 Chat~Gifts~ProductionClient~Reddit.7b5296f32bde5e0b77a1.js:1:77813 


Another useless (for users) example:

38 MyAnimeList:537:1
https://myanimelist.cdn-dena.com/r/23x32/images/characters/15/308085.jpg?s=c67b220603b5faabafffb755504cbba2 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/voiceactors/2/36143.jpg?s=a3fd4ddc092168187ed0c741ea9168fd MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/characters/5/308084.jpg?s=bfdce8835e6d8b255c76b5192af6a4b5 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/voiceactors/2/35989.jpg?s=6fc4fc09060916a83980d8afe9cabde5 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/characters/15/315189.jpg?s=0ebd39441529f3184e1f2591be6c0d84 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/voiceactors/1/24301.jpg?s=b4c894e4aed6c006d3f1760f281c8f94 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/characters/14/315198.jpg?s=35c1ac32813c2314437bdc593cb258ca MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/voiceactors/2/41532.jpg?s=241a2884838a2fb1f77be474bafbc85a MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/characters/9/315195.jpg?s=e1ae4dfbfdae2f9f5762d44314584bf8 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/voiceactors/3/44597.jpg?s=9599b5427d421da8963178f9a4b2b9b1 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/questionmark_23.gif?s=f0d17be5a46f7de113f7dbbb23ae5e1a MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/voiceactors/1/12771.jpg?s=6e44e0e04b42aafe1e1c02a38bf518ae MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/characters/16/315196.jpg?s=472a79faf81a3b292cbac34d78b8c568 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/voiceactors/2/43600.jpg?s=74e776f4dde94445569f7558103b2209 MyAnimeList:540:44
https://myanimelist.cdn-dena.com/r/23x32/images/characters/3/345768.jpg?s=80d2002b0ab6a1e2bfec1f644a1f2a9d MyAnimeList:540:44
You need to log in before you can comment on or make changes to this bug.