vtoubiana / TrackMeNot-Chrome

TrackMeNot portage on Chrome
GNU General Public License v2.0
45 stars 16 forks source link

forking TrackMeNot-Chrome #1

Open chew-z opened 7 years ago

chew-z commented 7 years ago

If there is more then one RSS feed this extension never gets results from any other then the last feed and sometimes it takes results from the last feed multiple times. So you end up with multiple extracted feeds with the same content.

This is caused by bug in handling of async requests by req.onreadystatechange() in doRssFetch(). (Chrome 58)

I got irritated by this bug so I have rewritten this function:

    function doRssFetch(feedUrl) {
        debug('doRSSFetch: ' + feedUrl);
        try {
            var req = new XMLHttpRequest();
            req.open('GET', feedUrl, true); // false == not async but this is depreciated
            req.onreadystatechange = function() {
                if (req.readyState == 4 && req.status == 200 && req.responseXML != null) {
                    debug("doRSSFetch: Recieved feed from " + feedUrl);
                    var adds = extractRssTitles(req.responseXML, feedUrl);
                    // debug(req.responseXML);
                    // debug(req.responseText);
                }
            }
            req.send();
        } catch (ex) {
            cout("[WARN]  doRssFetch(" + feedUrl + ")\n" +
                "  " + ex.message + " | Using defaults...");
            return; 
        }
    }

Unfortunately it had been only a start for me as I have got sucked in experimenting with augmenting logic of this extension.

The result is this fork

I have stripped away some logic, refactored some code and also added XregExp and nlp_compromise libraries. So now it can handle queries in other scripts like Chinese (if you seed with some foreign RSS feed for example) and also do some NLP - extracting more meaningful queries from search results. This could be of course extended.

I am not trying to say that mine is better. Just enjoyed testing some ideas.

dhowe commented 7 years ago

Looks interesting -- how much time do you imagine being able to spend on it over say, the next few months ?

chew-z commented 7 years ago

Ha, Since you have re-factored your code I had been trying to merge my changes but that appeared to be quite mundane since I have renamed some variables, moved some functions, re indented code etc. And this is some 1600 line of code. So I have given up and moved to other projects.

Main reason of my frustration was however that I could not reach escape velocity - no matter how I have seeded after some time I ended with quite narrow range of dumb queries. Guess GIGO especially in case of Google. :)

I needed some fresh ideas.

Anyway I am working on something a bit similar now and thinking of going back to TrackMeNot. Sure, I have time on my hands over next couple of months.