-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable console in contentscript #10040
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [8f88e2f]
Page Load Metrics (551 ± 29 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- contentscript lockdown logs 3x times via console.log
console.log
only is silenced to explicitly address this (ok to expand to other console methods)- sentry console breadcrumb gathering should still work even if logging to console is ultimately disabled. they override console methods to collect breadcrumb then call original console method, our noop
It looks like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to what @Gudahtt pointed out, we have a number of log statements in contentscript.js
that are useful for development in particular.
I'd also hate to lose this one: https://github.com/MetaMask/metamask-extension/blob/develop/app/scripts/contentscript.js/#L42
To follow up on my previous comment, if the content script blows up, the inpage script should (as of late) do enough console logging to hold us over in production. |
8f88e2f
to
316844e
Compare
Builds ready [316844e]
Page Load Metrics (551 ± 25 ms)
|
Builds ready [31d1dbc]
Page Load Metrics (656 ± 40 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem discovered; looks good otherwise
Co-authored-by: Mark Stacey <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Builds ready [a73b5b6]
Page Load Metrics (623 ± 26 ms)
|
Logging in the content scripts surfaces to the external page console. SES/lockdown's logging of removals was appearing in the web console on every web page. This fix renders
console
useless inside of content scripts to avoid this.