Back to Parent

document.addEventListener('DOMContentLoaded', function() {

#popup.js
  var submitPageButton = document.getElementById('submitUrl');
  submitPageButton.addEventListener('click', function() {

    chrome.tabs.getSelected(null, function(tab) {
      d = document;
      var xhr = new XMLHttpRequest();
      xhr.open("GET", "https://tipoffapp.herokuapp.com/submit?url=" + tab.url, true);
      xhr.onreadystatechange = function(){
        if( xhr.readyState == 4 ){
          document.getElementById("passwordHelp").innerHTML = "Website logged";
          document.getElementById("addUrlIfUnRegistered").style.display = 'block';
        }
      }
      xhr.send();

    });
  }, false);
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0