mirror of
https://github.com/Oreolek/TrackMeNot-Chrome.git
synced 2024-04-25 21:59:21 +03:00
Merged some changes from wrapperband
This commit is contained in:
parent
b3a2bd271d
commit
153445a5a3
|
@ -2,7 +2,7 @@
|
|||
"manifest_version": 2,
|
||||
"name": "TrackMeNot",
|
||||
"description": "TMN WebExtension portage",
|
||||
"version": "0.10.10",
|
||||
"version": "0.10.11",
|
||||
"background": {
|
||||
"scripts": [
|
||||
"trackmenot.js"
|
||||
|
|
|
@ -122,7 +122,7 @@ function TMNClearLogs() {
|
|||
|
||||
function TMNShowLog() {
|
||||
let logs = tmn._getLogs();
|
||||
let htmlStr = '<table witdh=500 cellspacing=3 bgcolor=white frame=border>';
|
||||
let htmlStr = '<table width=500 cellspacing=3 bgcolor=white frame=border>';
|
||||
htmlStr += '<thead><tr align=left>';
|
||||
htmlStr += '<th>Engine</th>';
|
||||
htmlStr += '<th>Mode</th>';
|
||||
|
@ -167,7 +167,7 @@ function TMNShowEngines(engines) {
|
|||
function TMNShowQueries() {
|
||||
let sources = tmn._getAllQueries();
|
||||
let htmlStr = '<a href="#userlist">Userlist</a> | <a href="#dhs">DHS</a> | <a href="#rss"> RSS </a> | <a href="#popular"> Popular </a>|<a href="#extracted"> Extracted</a>';
|
||||
htmlStr += '<div style="height:1000px;overflow:auto;"><table witdh=500 cellspacing=3 bgcolor=white frame=border>';
|
||||
htmlStr += '<div style="height:1000px;overflow:auto;"><table width=500 cellspacing=3 bgcolor=white frame=border>';
|
||||
let default_options = tmn._getOptions();
|
||||
|
||||
if ( sources.userlist ) {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"fullName" : "TrackMeNot",
|
||||
"license": "GPL 2.0",
|
||||
"author": "Daniel Howe, Helen Nissenbaum, Vincent Toubiana",
|
||||
"version": "0.10.10",
|
||||
"version": "0.10.11",
|
||||
"homepage": "http://www.cs.nyu.edu/trackmenot/",
|
||||
"icon":"data/images/skin/tmn.png",
|
||||
"main": "trackmenot",
|
||||
|
|
|
@ -533,17 +533,19 @@ TRACKMENOT.TMNSearch = function() {
|
|||
// Parse the HTML into phrases
|
||||
let l = html.split(/((<\?tr>)|(<br>)|(<\/?p>))/i);
|
||||
for (let i = 0; i < l.length; i++) {
|
||||
if (!l[i] || l[i] == 'undefined') continue;
|
||||
l[i] = l[i].replace(/(<([^>]+)>)/ig, ' ');
|
||||
//if (/([a-z]+ [a-z]+)/i.test(l[i])) {
|
||||
//let reg = /([a-z]{4,} [a-z]{4,} [a-z]{4,} ([a-z]{4,} ?) {0,3})/i;
|
||||
let matches = l[i].split(' ');//reg.exec(l[i]);
|
||||
if (!matches || matches.length < 2)
|
||||
if (!l[i] || l[i] == 'undefined')
|
||||
continue;
|
||||
let newQuery = trim(matches[1]);
|
||||
// if ( phrases.length >0 ) newQuery.unshift(" ");
|
||||
if (newQuery && phrases.indexOf(newQuery) < 0)
|
||||
phrases.push(newQuery);
|
||||
l[i] = l[i].replace(/(<([^>]+)>)/ig, ' ');
|
||||
if (/([a-z]+ [a-z]+)/i.test(l[i])) {
|
||||
let reg = /([a-z]{4,} [a-z]{4,} [a-z]{4,} ([a-z]{4,} ?) {0,3})/i;
|
||||
let matches = l[i].split(' ');//reg.exec(l[i]);
|
||||
if (!matches || matches.length < 2)
|
||||
continue;
|
||||
let newQuery = trim(matches[1]);
|
||||
// if ( phrases.length >0 ) newQuery.unshift(" ");
|
||||
if (newQuery && phrases.indexOf(newQuery) < 0)
|
||||
phrases.push(newQuery);
|
||||
}
|
||||
}
|
||||
|
||||
const queryToAdd = phrases.join(' ');
|
||||
|
@ -951,7 +953,8 @@ TRACKMENOT.TMNSearch = function() {
|
|||
}
|
||||
|
||||
function scheduleNextSearch(delay) {
|
||||
if (!enabled) return;
|
||||
if (!enabled)
|
||||
return;
|
||||
if (delay > 0) {
|
||||
if (!isBursting()) { // randomize to approach target frequency
|
||||
let offset = delay * (Math.random() / 2);
|
||||
|
@ -960,8 +963,10 @@ TRACKMENOT.TMNSearch = function() {
|
|||
delay += delay * (Math.random() - 0.5);
|
||||
}
|
||||
}
|
||||
if (isBursting()) engine = burstEngine;
|
||||
else engine = chooseEngine(searchEngines.split(','));
|
||||
if (isBursting())
|
||||
engine = burstEngine;
|
||||
else
|
||||
engine = chooseEngine(searchEngines.split(','));
|
||||
debug('NextSearchScheduled on: ' + engine);
|
||||
tmn_errTimeout = window.setTimeout(rescheduleOnError, delay * 3);
|
||||
tmn_searchTimer = window.setTimeout(doSearch, delay);
|
||||
|
|
Loading…
Reference in a new issue