mirror of
https://github.com/Oreolek/TrackMeNot-Chrome.git
synced 2024-06-17 07:21:08 +03:00
Merged some changes from wrapperband
This commit is contained in:
parent
b3a2bd271d
commit
153445a5a3
|
@ -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.10",
|
"version": "0.10.11",
|
||||||
"background": {
|
"background": {
|
||||||
"scripts": [
|
"scripts": [
|
||||||
"trackmenot.js"
|
"trackmenot.js"
|
||||||
|
|
|
@ -122,7 +122,7 @@ function TMNClearLogs() {
|
||||||
|
|
||||||
function TMNShowLog() {
|
function TMNShowLog() {
|
||||||
let logs = tmn._getLogs();
|
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 += '<thead><tr align=left>';
|
||||||
htmlStr += '<th>Engine</th>';
|
htmlStr += '<th>Engine</th>';
|
||||||
htmlStr += '<th>Mode</th>';
|
htmlStr += '<th>Mode</th>';
|
||||||
|
@ -167,7 +167,7 @@ function TMNShowEngines(engines) {
|
||||||
function TMNShowQueries() {
|
function TMNShowQueries() {
|
||||||
let sources = tmn._getAllQueries();
|
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>';
|
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();
|
let default_options = tmn._getOptions();
|
||||||
|
|
||||||
if ( sources.userlist ) {
|
if ( sources.userlist ) {
|
||||||
|
|
|
@ -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.10",
|
"version": "0.10.11",
|
||||||
"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",
|
||||||
|
|
|
@ -533,10 +533,11 @@ TRACKMENOT.TMNSearch = function() {
|
||||||
// Parse the HTML into phrases
|
// Parse the HTML into phrases
|
||||||
let l = html.split(/((<\?tr>)|(<br>)|(<\/?p>))/i);
|
let l = html.split(/((<\?tr>)|(<br>)|(<\/?p>))/i);
|
||||||
for (let i = 0; i < l.length; i++) {
|
for (let i = 0; i < l.length; i++) {
|
||||||
if (!l[i] || l[i] == 'undefined') continue;
|
if (!l[i] || l[i] == 'undefined')
|
||||||
|
continue;
|
||||||
l[i] = l[i].replace(/(<([^>]+)>)/ig, ' ');
|
l[i] = l[i].replace(/(<([^>]+)>)/ig, ' ');
|
||||||
//if (/([a-z]+ [a-z]+)/i.test(l[i])) {
|
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 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]);
|
let matches = l[i].split(' ');//reg.exec(l[i]);
|
||||||
if (!matches || matches.length < 2)
|
if (!matches || matches.length < 2)
|
||||||
continue;
|
continue;
|
||||||
|
@ -545,6 +546,7 @@ TRACKMENOT.TMNSearch = function() {
|
||||||
if (newQuery && phrases.indexOf(newQuery) < 0)
|
if (newQuery && phrases.indexOf(newQuery) < 0)
|
||||||
phrases.push(newQuery);
|
phrases.push(newQuery);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const queryToAdd = phrases.join(' ');
|
const queryToAdd = phrases.join(' ');
|
||||||
TMNQueries.extracted = [].concat(TMNQueries.extracted);
|
TMNQueries.extracted = [].concat(TMNQueries.extracted);
|
||||||
|
@ -951,7 +953,8 @@ TRACKMENOT.TMNSearch = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function scheduleNextSearch(delay) {
|
function scheduleNextSearch(delay) {
|
||||||
if (!enabled) return;
|
if (!enabled)
|
||||||
|
return;
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
if (!isBursting()) { // randomize to approach target frequency
|
if (!isBursting()) { // randomize to approach target frequency
|
||||||
let offset = delay * (Math.random() / 2);
|
let offset = delay * (Math.random() / 2);
|
||||||
|
@ -960,8 +963,10 @@ TRACKMENOT.TMNSearch = function() {
|
||||||
delay += delay * (Math.random() - 0.5);
|
delay += delay * (Math.random() - 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isBursting()) engine = burstEngine;
|
if (isBursting())
|
||||||
else engine = chooseEngine(searchEngines.split(','));
|
engine = burstEngine;
|
||||||
|
else
|
||||||
|
engine = chooseEngine(searchEngines.split(','));
|
||||||
debug('NextSearchScheduled on: ' + engine);
|
debug('NextSearchScheduled on: ' + engine);
|
||||||
tmn_errTimeout = window.setTimeout(rescheduleOnError, delay * 3);
|
tmn_errTimeout = window.setTimeout(rescheduleOnError, delay * 3);
|
||||||
tmn_searchTimer = window.setTimeout(doSearch, delay);
|
tmn_searchTimer = window.setTimeout(doSearch, delay);
|
||||||
|
|
Loading…
Reference in a new issue