7 lesser known hacks for debugging in Visual Studio

https://blogs.msdn.microsoft.com/visualstudio/2017/06/26/7-lesser-known-hacks-for-debugging-in-visual-studio/

Advertisements

Browser diversity is good for the web

Develop for the web, not for a browser! Here’s a good quick read about why having a single web browser for all operating systems and devices would not be a good thing:

medium.com/samsung-internet-dev/because-browser-diversity-is-good-for-the-web-910d1cbcdf3b

The article also included this quote from Steve Jobs that I found kind of interesting:

“What’s the point of focusing on making the product even better when the only company you can take business from is yourself?”

Competing browsers are part of what drives innovation on the web. Developing for the ever-changing hardware and software landscape of the web is definitely a challenge. It is important to test websites thoroughly – you want your users to have a good experience regardless of the device and browser they are using.

 

Linking to another page using target=”_blank” can hinder performance and pose a security risk

I recently learned that using target="_blank" to have links open in a new tab causes the new page to run on the same process as your page. If the new link is executing large chunks of JavaScript, your page’s performance may also suffer.  But in addition to a potential performance hit, using  target="_blank" is also a security vulnerability.  Using rel=noopener is recommended.  This will prevent the newly opened page from accessing your window object via window.opener.

<a href="http://mylink.com" target="_blank" rel="noopener">My Link</a>

WordPress began implementing this when adding a hyperlink to text and selecting the “Open link in new window/tab” checkbox.  It does not appear that rel=noopener is supported by Edge at this time.

Here is some more info on rel=noopener:

developers.google.com/web/tools/lighthouse/audits/noopener

Here are a few examples demonstrating the security vulnerability and how the page that is linked to can manipulate the original page.

mathiasbynens.github.io/rel-noopener

jakearchibald.com/2016/performance-benefits-of-rel-noopener

You Might Not Need jQuery

Here’s a cool website I found that shows how to do some common tasks using both jQuery and plain vanilla JavaScript:

youmightnotneedjquery.com

I thought it was kinda cool to see what exactly some of the common jQuery functions are actually doing behind the scenes with JS and CSS.  Sometimes I like to keep things as simple as possible, especially for smaller adhoc apps.  Once upon a time I had a small app that needed to make just one single POST request.  Instead of including jQuery as a dependency in the project and written something like this:

$.ajax({
 type: 'POST',
 url: '/my/app/url',
 data: myData
});

I used some plain JS instead like this:

var request = new XMLHttpRequest();
request.open('POST', '/my/app/url', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.send(myData);

Check out the GitHub repo as well for lots more examples.

SSL Certificate Explained

I really like this quick and easy to understand explanation of HTTPS/SSL.  I shared this with my company’s blog a few days ago as we are beginning to enforce HTTPS on our applications.  I wanted everyone on my team to understand what HTTPS is, and why it is important that we begin using HTTPS on all the custom apps we develop for clients.