Product review (5 stars): How to fix the wiring harness
Replacing the lid switch was easy, and I'm very happy with the quality of the replacement part.

When the old lid switch melted, it ruined the connector on the wiring harness, too. I didn't want to spend $150 on a new wiring harness, so I did some homework and found out how to replace the damaged connector. That saved a ton of money.  This seems to be a common issue, so I'll provide the details here.

The connector that fits this switch is&nbsp;<a data-hook="product-link-linked" class="a-link-normal" href="/Whirlpool-part-WP2172937/dp/B00LOWYTT6/ref=cm_cr_arp_d_rvw_txt?ie=UTF8">Whirlpool part WP2172937</a>. That's just the plastic connector. The terminals inside the connector have to be purchased separately.

For anyone attempting this repair, I don't recommend reusing the terminals from the original connector. It's very difficult to remove them from the old connector without bending them up and making them unusable. Just cut them off, preserving as much of the wire as you can. I had to replace a section of the white wire because the insulation was toasted and the wire was tarnished for a couple of inches. I used a lineman's splice with solder and heat shrink tubing. There are plenty of YouTube videos that describe this procedure.

When the new connector arrived, I found the manufacturer's name and part number stamped on it. Whirlpool WP2172937 cost me $11, but it's actually a repackaged Molex 43335, which can be purchased from mouser.com for $0.55. I found the connector terminals using the Molex website. Their part number is 43375-0001. You can get them for a few cents from mouser.com, but I opted to buy a&nbsp;<a data-hook="product-link-linked" class="a-link-normal" href="/package-of-10-from-Amazon/dp/B00MMYTRJM/ref=cm_cr_arp_d_rvw_txt?ie=UTF8">package of 10 from Amazon</a>&nbsp;so I could take advantage of Prime shipping. (It's good to have some extra terminals for practice, anyway.)

You'll need a crimper for the terminals. The official Molex crimper is $500. Fortunately, I found a&nbsp;<a data-hook="product-link-linked" class="a-link-normal" href="/much-cheaper-one-that-works-well/dp/B073VH2WJC/ref=cm_cr_arp_d_rvw_txt?ie=UTF8">much cheaper one that works well.</a>&nbsp;This crimper comes with 5 dies. For these terminals, use the "1.5-2.5" slot on the "LG" die. It does the conductor crimp and the insulation crimp at the same time. Make sure the terminal is oriented the right way, then insert it into the crimper without the wire and close the crimper just until the first click. The crimper will then hold the terminal securely, making it easy to insert the wire. After the wire's in, squeeze the crimper all the way.

After the terminal is attached to the wire, you can slide the terminal into the connector with little effort and it will click into place.