Facebook login hangs at “XD Proxy” when page is installed via Chrome Web Store

后端 未结 8 2385
长情又很酷
长情又很酷 2021-01-31 06:25

The created the following web application:

http://www.web-allbum.com/

I also added it to the Chrome Web Store:

https://chrome.google.com/webstore/detail/

8条回答
  •  灰色年华
    2021-01-31 06:57

    I was experiencing same problem for all browsers. When user clicked "login" button, a popup opened and hanged; and unless user killed browser process, it caused a high load on CPU. If user managed to see "allow" button and click it however, then it appeared a "xd proxy" blank window and nothing happened. That was the problem.

    After long investigations, I noticed my new JS code which proxies setInterval/clearInterval/setTimeout/clearTimeout methods, caused this problem. Code is as follows:

    window.timeoutList = new Array();
    window.intervalList = new Array();
    
    window.oldSetTimeout = window.setTimeout;
    window.oldSetInterval = window.setInterval;
    window.oldClearTimeout = window.clearTimeout;
    window.oldClearInterval = window.clearInterval;
    
    window.setTimeout = function(code, delay) {
        window.timeoutList.push(window.oldSetTimeout(code, delay));
    };
    window.clearTimeout = function(id) {
        var ind = window.timeoutList.indexOf(id);
        if(ind >= 0) {
            window.timeoutList.splice(ind, 1);
        }
        window.oldClearTimeout(id);
    };
    window.setInterval = function(code, delay) {
        window.intervalList.push(window.oldSetInterval(code, delay));
    };
    window.clearInterval = function(id) {
        var ind = window.intervalList.indexOf(id);
        if(ind >= 0) {
            window.intervalList.splice(ind, 1);
        }
        window.oldClearInterval(id);
    };
    window.clearAllTimeouts = function() {
        for(var i in window.timeoutList) {
            window.oldClearTimeout(window.timeoutList[i]);
        }
        window.timeoutList = new Array();
    };
    window.clearAllIntervals = function() {
        for(var i in window.intervalList) {
            window.oldClearInterval(window.intervalList[i]);
        }
        window.intervalList = new Array();
    };
    

    Removing these lines solved my problem. Maybe it helps to who experiences the same.

提交回复
热议问题