Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/laion/many request haproxy #17

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions proxy_error_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,40 +69,8 @@ ProxyErrorHandler.prototype = {
* @private
*/
handleError_: function(details) {
var xhttp = new XMLHttpRequest();
xhttp.addEventListener("error", transferFailed );
xhttp.addEventListener("load", transferComplete);
xhttp.open("GET", "https://geoip.nekudo.com/api/", true);
xhttp.send();

function transferFailed(){
var RED = [255, 0, 0, 255];
var YELLOW = [255, 205, 0, 255];

// Badge the popup icon.
var color = details.fatal ? RED : YELLOW;
chrome.browserAction.setBadgeBackgroundColor({color: color});
chrome.browserAction.setBadgeText({text: 'X'});
chrome.browserAction.setTitle({
title: chrome.i18n.getMessage('errorPopupTitle', details.error)
});
}

// Store the error for display in the popup.
this.lastError_ = JSON.stringify(details);

function transferComplete(){
if(document.getElementById('proxyFail') !== null){
document.getElementById('proxyFail').setAttribute('hidden', 'hidden');
var GREEN = [124, 252, 0, 255];
chrome.browserAction.setBadgeText({text: 'o'});
chrome.browserAction.setBadgeBackgroundColor({color: GREEN});
chrome.browserAction.setTitle({
title: chrome.i18n.getMessage('connectedPopupTitle')
});
}

}
},


Expand All @@ -124,14 +92,6 @@ ProxyErrorHandler.prototype = {
chrome.browserAction.setTitle({
title: chrome.i18n.getMessage('extDescription')
});
if(window.localStorage['proxyConfig'][20] == "f"){
var GREEN = [124, 252, 0, 255];
chrome.browserAction.setBadgeText({text: 'o'});
chrome.browserAction.setBadgeBackgroundColor({color: GREEN});
chrome.browserAction.setTitle({
title: chrome.i18n.getMessage('connectedPopupTitle')
});
}
this.lastError_ = null;
}
}
Loading