Feature request: URL parameter to disable console logging
- Dominant language
- JavaScript
- Stars
- 35.8k
- Forks
- 4.1k
- Avg merge
- 2d 26m
- Merged PRs (30d)
- 33
Description
**Is your feature request related to a problem? Please describe.**
My use case is implementing this application in an iFrame, where ideally I would like to avoid logging to the console if possible. Some of the output I would like to avoid being displayed is the following:

**Describe the solution you'd like**
A URL parameter specifying that nothing should be output to the console, something like `?logging=false`.
**Describe alternatives you've considered**
I have tried to intercept calls to `console.*` on my end, but since it is a cross-origin iframe, the following code just results in a DOMException:
```js
iframe.onload = () => {
iframe.contentWindow.console.log = () => {};
iframe.contentWindow.console.error = () => {};
iframe.contentWindow.console.warn = () => {};
iframe.contentWindow.console.info = () => {};
iframe.contentWindow.console.debug = () => {};
}
```
**Additional context**
The implementation would simply need to be something along the lines of the following when the URL parameter is present:
```js
window.console.log = () => {};
window.console.error = () => {};
window.console.warn = () => {};
window.console.info = () => {};
window.console.debug = () => {};
```
Contributor guide
Assessment
This issue has not been assessed yet.