// Filename: popup.js
// Date:     July 2017
// Authors:  Evgeni Dobranov & Thomas Binu
// Purpose:  Defines extension UI and functional behavior

// Entry point into app functionality
function onPopupLoad(){

    // Immediately inject script to get page content
    chrome.tabs.executeScript(null, { file: "js/contentscript.js" }, function(response)
    {
        if (chrome.runtime.lastError) {
            console.log("Chrome runtime error: ", chrome.runtime.lastError.message);
        }
    });

    // Listener for communication with contentscript.js
    chrome.runtime.onMessage.addListener(function(request, sender) {
        if (request.action == "getSource") {

            var pageContent = (request.source).toString();
            var pageContentCleaned = pageContent.replace(/[^a-zA-Z\s]/gi, '').replace(/(\r\n|\n|\r)/gm,'');
            var places = main(pageContentCleaned);
            console.log(places)
            // places = ['Seattle', 'Miami', 'Chicago', 'Moscow', 'Tahiti', 'Hawaii', 'Fiji', 'Bulgaria', 'India', 'Belgium', 'France', 'Brussels', 'Madrid']

            renderEsriMap(places);
            $('#splash').hide()
        }
    });

}
window.onload = onPopupLoad;
@@ -790,16 +790,24 @@
 %5B%5Ea-zA-Z
+0-9.,:;'
 %5Cs%5D/gi, 
@@ -836,16 +836,108 @@
 %5Cr)/gm,'
+ ')//.replace(/(?:%5BA-Z%5D+%5Ba-z%5D%7B2,%7D(?:and%7Cof%7Cis%7Cto%7Cthe%7Ca%7Cfrom%7Cin%7Cout)*%5B A-za-z%5C&,-:%5D*)%7B4,%7D/, '
 ');%0A    
@@ -987,40 +987,8 @@
 d);%0A
-            console.log(places)%0A
     
@@ -1258,8 +1258,9 @@
 pupLoad;
+%0A

Update regex that cleans page content