1
0
Fork 0
mirror of https://github.com/Oreolek/TrackMeNot-Chrome.git synced 2024-06-26 03:41:00 +03:00

Reload after engine changes, fix randomElt for RSS

This commit is contained in:
Alexander Yakovlev 2016-12-13 22:47:39 +07:00
parent 45b747cfaf
commit f5d1c673ce
4 changed files with 21 additions and 9 deletions

View file

@ -2,7 +2,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "TrackMeNot", "name": "TrackMeNot",
"description": "TMN WebExtension portage", "description": "TMN WebExtension portage",
"version": "0.10.4", "version": "0.10.5",
"background": { "background": {
"scripts": [ "scripts": [
"trackmenot.js" "trackmenot.js"

View file

@ -51,6 +51,9 @@ function loadHandlers() {
'tmn':"TMNDelEngine", 'tmn':"TMNDelEngine",
'engine':del_engine 'engine':del_engine
}); });
setTimeout(function() {
window.location.reload()
}, 500);
}); });
$("#help-faq").click( function() { $("#help-faq").click( function() {
@ -70,7 +73,13 @@ function loadHandlers() {
alert("Did not find 'trackmenot' in the URL"); alert("Did not find 'trackmenot' in the URL");
return; return;
} }
browser.runtime.sendMessage({'tmn':"TMNAddEngine",'engine': engine}); browser.runtime.sendMessage({
'tmn':"TMNAddEngine",
'engine': engine
});
setTimeout(function() {
window.location.reload()
}, 500);
}); });
} }

View file

@ -11,7 +11,7 @@
"fullName" : "TrackMeNot", "fullName" : "TrackMeNot",
"license": "GPL 2.0", "license": "GPL 2.0",
"author": "Daniel Howe, Helen Nissenbaum, Vincent Toubiana", "author": "Daniel Howe, Helen Nissenbaum, Vincent Toubiana",
"version": "0.10.4", "version": "0.10.5",
"homepage": "http://www.cs.nyu.edu/trackmenot/", "homepage": "http://www.cs.nyu.edu/trackmenot/",
"icon":"data/images/skin/tmn.png", "icon":"data/images/skin/tmn.png",
"main": "trackmenot", "main": "trackmenot",

View file

@ -24,7 +24,7 @@ TRACKMENOT.TMNSearch = function() {
let tmn_tab = null; let tmn_tab = null;
let useTab = false; let useTab = false;
let enabled = true; let enabled = true;
let debug_ = true; let debug_ = false;
let load_full_pages = false; let load_full_pages = false;
let last_url = ""; let last_url = "";
let stop_when = "start"; let stop_when = "start";
@ -542,15 +542,15 @@ TRACKMENOT.TMNSearch = function() {
let qtype = randomElt(typeoffeeds); let qtype = randomElt(typeoffeeds);
let queries = TMNQueries[qtype]; let queries = TMNQueries[qtype];
queries = randomElt(queries); queries = randomElt(queries);
if (queries.words) {
queries = queries.words;
queries = randomElt(queries);
}
if (queries === null || queries === undefined) { if (queries === null || queries === undefined) {
console.log(TMNQueries); console.log(TMNQueries);
debug(qtype); debug(qtype);
debug(typeoffeeds); debug(typeoffeeds);
} }
if (queries.words && queries.words.length > 0) {
queries = queries.words;
queries = randomElt(queries);
}
let term = trim( queries ); let term = trim( queries );
if (!term || term.length === 0) { if (!term || term.length === 0) {
if (debug_) if (debug_)
@ -726,6 +726,9 @@ TRACKMENOT.TMNSearch = function() {
//console.log (feedObject.name + " : " + feedObject.words) //console.log (feedObject.name + " : " + feedObject.words)
if (useRss) { if (useRss) {
if (TMNQueries.rss === undefined) {
TMNQueries.rss = [];
}
TMNQueries.rss.push(feedObject); TMNQueries.rss.push(feedObject);
} }
@ -1440,7 +1443,7 @@ TRACKMENOT.TMNSearch = function() {
sendResponse({}); sendResponse({});
break; break;
case "TMNAddEngine": case "TMNAddEngine":
alert(request.engine); console.log(request.engine);
addEngine(request.engine); addEngine(request.engine);
sendResponse({}); sendResponse({});
break; break;