Node-WebKit series (01): How do I fix bugs in open-source projects?

Source: Internet
Author: User
This blog post focuses on fixing the bug and merge process of an open-source project: node-WebKit (which can be explained in my previous blog. I want to summarize some methods and accumulate experience. (Note: The following NW is node-WebKit)

Bug

Link to issue on GitHub: https://github.com/rogerwang/node-webkit/issues/403question: in NW, as shown in

 
<AHref= "Mailto: xxxx@gmail.com">Mail</A>

Such hyperlink labels cannot open the default mail sending client in the system as in the browser (such as chrome. Another example:

<AHref= "GitHub-Windows: // openrepo/https://github.com/rogerwang/node-webkit">Clone in Windows</A>

Such links cannot work normally.

Problem Analysis
  1. At first, I guess why the same link in chrome can be opened normally (some confirmation dialog boxes will pop up based on different protocols ), for example, a dialog box pops up when I click the clone in Windows link of the repository on GitHub. Should this click event on tags in HTML be implemented in WebKit? However, after careful observation, we found that this dialog box is unique in chrome. However, NW is implemented based on the chrome content API. That is to say, in NW, there should be some functions that respond to this event! So I started the process of searching for this function.
  2. After learning about the chrome architecture and the NW architecture, I began to look for the implementation in chrome as a reference for my patch. At the very beginningCodeThe amount is just a needle in a haystack. Then we suddenly thought that we could find out if any related bug exists in chrome? In this case, you can check the patch record and probably know where to implement it! So on the chrome issue tracking system: https://code.google.com/p/chromium/issues/list search mailto status = Fixed (all issues), is this simple keyword search, I found the following issue: https://code.google.com/p/chromium/issues/detail? Id = 20696. Read the description of this issue carefully and find that it is consistent with the Code that needs to be completed in NW!
  3. But when I am very happy to open a link and want to see which code has been modified, my God, how can this code disappear. (In Chrome projects, some objects are often moved to a folder, so it is not surprising, but the file names are generally not changed ). So I started searching for the external_protocol_handler.cc file.
  4. Google chromium has a powerful tool in this project! Code Search: https://code.google.com/p/chromium/codesearch this tool has recently upgraded some features (https://groups.google.com/a/chromium.org/forum! Starred/chromium-dev/lnkihhajvya )! Use external_protocol_handler to search and find the following code: External. After carefully reading the comments, I am more sure what I need.
  5. The next thing is to read the code and find out what you need. The commit is as follows: https://github.com/rogerwang/node-webkit/commit/0bcc9840660d390c463ffc061a55ce280d5dc629
What have I learned?
    1. A problem, even if you don't seem to have a clue, can be solved through a certain method: using tools rationally and step by step under a slightly organized inference.
    2. Think about itProgramMember.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.