Skip to content
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

Remove console logs from production build #386

Open
ghost opened this issue Mar 11, 2021 · 5 comments · Fixed by #598
Open

Remove console logs from production build #386

ghost opened this issue Mar 11, 2021 · 5 comments · Fixed by #598

Comments

@ghost
Copy link

ghost commented Mar 11, 2021

Would it be possible to remove all console.log() calls in the production build? The extension frequently logs errors to the console and as a dev, it's distracting. Most commonly, this part of the code throws an error when "x or y are negative, outside viewport, or there is no text entry node" and range ends up null. For me, mousing over the scrollbar often triggers this. I'm using Chrome 89 though this issue has been present on previous versions as well.

range = document.caretRangeFromPoint(ev.clientX, ev.clientY);
rp = range.startContainer;

image

Really appreciate the work on this extension :)

@melink14
Copy link
Owner

I removed info logs awhile back but not error logs.
I think having error logs is important for people reporting bugs though in general.

Maybe there's a way to format the logs so they're easily hidden using dev tools. Could also try to make that particular error less common. It's never really been looked at for years.

@ghost
Copy link
Author

ghost commented Mar 11, 2021

That's fair; in Chrome at least I can check "Selected context only" to hide the logs from unrelated contexts like extensions. A fix would also be appreciated but I understand if it's not a high priority. Thanks!

@melink14
Copy link
Owner

melink14 commented Mar 11, 2021 via email

@mergify mergify bot closed this as completed in #598 Jul 17, 2021
mergify bot pushed a commit that referenced this issue Jul 17, 2021
Avoid raising errors when range is null. Calling caretRangeFromPoint when "x or y are negative, outside viewport, or there is no text entry node" will return null. One common example is hovering over a scrollbar.

Fixes #386
melink14 pushed a commit that referenced this issue Jul 17, 2021
## [2.0.0](v1.2.6...v2.0.0) (2021-07-17)

### ⚠ BREAKING CHANGES

* This version includes optional chaining requiring Chrome >=80

### Features

* Force Google Docs to use HTML mode instead of canvas mode ([#596](#596)) ([94b60a6](94b60a6)), closes [#593](#593)
* **detection:** Ignore invisible nodes when extracting text under mouse ([#561](#561)) ([cb97f36](cb97f36)), closes [#159](#159) [#366](#366) [#159](#159)

### Bug Fixes

* **dict:** Update dictionaries to latest versions. ([#581](#581)) ([77189c3](77189c3))
* Skip text processing when range is null ([#598](#598)) ([ae55bff](ae55bff)), closes [#386](#386)

### Code Refactoring

* Migrate from webpack to snowpack for build step ([#583](#583)) ([1bdd3d3](1bdd3d3))
@melink14
Copy link
Owner

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@melink14
Copy link
Owner

I will re-open this issue as I think it's worth thinking about solving this in a general way.

@melink14 melink14 reopened this Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant