I’m trying to run this piece of code to check for errors in sublime text.
Is this possible natively or with the help of an additional package?
String.prototype.getURLTitle = function() {
urlTest = new ActiveXObject('Microsoft.XMLHTTP');
try {
urlTest.open('GET', this, false);
urlTest.send();
var title = urlTest.responseText.replace(/[\S\s]*?<title>([^<]+?)<\/title>[\S\s]+/gm, '$1');
if (urlTest.status != 404) return title;
} catch(err) {return false}
}
var str = 'https://regex101.com'.getURLTitle();
console.log(str);