12

Problem Statement

I worked out a neat script to run in the Chrome DevTools console to make a configuration process faster. I went into my sandbox to reproduce the behavior so I could write it up in a Q&A post on here. Then I found something really strange and disturbing. It seems like Salesforce may have somehow disabled console output (at least in some sandboxes).

I did some digging and it looks like Facebook pioneered a strategy to disable the console. The basic gist of their approach is:

Object.defineProperty(console, '_commandLineAPI', { get : function() { throw 'Nope' } })

But that doesn't seem to be what Salesforce is doing.


Observed Behavior

Here is how I normally expect the console to behave:

Standard Console Behavior

Here's what it should look like after applying the hack:

Hacked Console Behavior

Here's what it looks like in my sandbox:

Sandbox Console Behavior

The console does still seem to be logging system messages:

System Logging


Conclusions & Questions

There is no output. I'm at a loss to why it's broken. I've searched around and most of the Stack Overflow posts (example) have to do with the filter settings, which clearly aren't the cause of these missing logs. The log output isn't being filtered out, it's just completely swallowed somewhere.

I can also confirm this is not a browser issue, as I'm able to use DevTools normally everywhere else, even in a new tab on the same window. The behavior is consistent across the Home Page, Object Tabs, Detail Pages, and Visualforce Pages (except when showHeader="false"). The behavior presents on cs45 and cs19, but not test.salesforce.com or login.salesforce.com.

  • Why is my console broken?
  • How can I fix it?
  • Is Salesforce engineering this behavior?
  • Should I expect this behavior in production soon?

Update

Now seeing this information on na20 as well, so I also see it hitting production.

12
  • 1
    When did this start? I just used the console yesterday in both sandboxes and production. I'll see if I can see the same behavior once I hop on a computer. Aug 10, 2016 at 20:33
  • 2
    Related: Chrome Developer Console not working Aug 10, 2016 at 23:57
  • 1
    Yeah, I saw that, but it's lacking in description and I can hardly add all this detail there!
    – Adrian Larson
    Aug 10, 2016 at 23:58
  • 1
    I noticed this happening as well with Chrome 52.. Rolling back to Chrome 51 seemed to resolve it for me. I don't know what, specifically, the problem is but for me it had to do with Chrome 52 Aug 11, 2016 at 23:52
  • 1
    This started happening with me as well going back a month or so ago when I was on the beta channel. It still continues. Currently on v52. Aug 17, 2016 at 12:47

3 Answers 3

9

I think this issue is only affecting Chrome 52 and is related to this bug. https://bugs.chromium.org/p/chromium/issues/detail?id=636409

The workarounds for now are to use Chrome 53 (or greater) or another browser. Also, turning off the standard Salesforce header resolves this issue.

3
1

I was having this exact problem and by chance finally stumbled across this page. Which was super helpful to me and WILL work.

However, I was just speaking with a co-worker of mine and he said he was also having this problem and came up with a different solution that I felt was merit to post here on this thread.

If you use the 'Salesforce Lightning Inspector' from the Chrome Web Store, it will fix the problem. When you are in the chrome console, instead of using the filter option 'Top' there will be a 'chrome-extension://[stuff]' option. If you choose this option you can use the console again. It also comes with additional features that I have not explored yet as well.

0
0

The problem is caused because of the visualforce main.js over riding the window.Map function. Following the steps in this Article resolves the issue Native JS Map prototype is overwritten in Visualforce page w/ a header

2
  • Yeah the posted fix does not work for any standard pages.
    – Adrian Larson
    Aug 13, 2016 at 14:45
  • Also, overwriting Map doesn't cause the same behavior. This answer is completely unrelated to the question at hand.
    – Adrian Larson
    Aug 17, 2016 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .