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

various cleanups while tracking down an issue #186

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

attila-lendvai
Copy link
Contributor

@attila-lendvai attila-lendvai commented Jul 14, 2022

various cleanups while tracking down why it doesn't work on https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_textarea

@attila-lendvai attila-lendvai mentioned this pull request Jul 14, 2022
@@ -102,6 +102,7 @@ chrome.commands.onCommand.addListener(function(command) {
function handleContentMessages(msg, tab_port)
{
console.log("handleContentMessages called:"+JSON.stringify(msg));
console.assert(msg.text);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the user visible effect here? Besides you can have empty text areas so what are we trying to catch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty text areas have an empty string as their content. this is checking for null.

it happens when the contextmenu event listener is not triggered, and the message contains no text. (or worse: with HEAD it uses the previous content)

the user visible effect is that nothing happens, besides the log in the console. not ideal, but IMO better than the previous behavior. at least people with knowledge can hone in much faster on the actual issue.

also, i'm suggesting to get rid of the current console.log stuff, and use console.debug where appropriate, and let the users decide in their console config how much log they want to see.

it took me hours to understand what was happening. with these changes it should be minutes at most.

@stsquad
Copy link
Owner

stsquad commented Jul 14, 2022

What is this PR trying to achieve? I don't really want to merge a bunch of ancillary code motions and debug logs unless they are going to be useful in the long term. What is the actual fix in here?

@attila-lendvai
Copy link
Contributor Author

attila-lendvai commented Jul 15, 2022

What is this PR trying to achieve? I don't really want to merge a bunch of ancillary code motions and debug logs unless they are going to be useful in the long term. What is the actual fix in here?

it fixes nothing. what it does is it greatly improves debuggability.

the issue that needs to be fixed is that the contextmenu event is not triggered at various places. e.g. see the link in the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants