First commit for Chrome
Not working code
1
dhs_keywords.json
Executable file
32
editeentry.xul
Executable file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<!DOCTYPE overlay SYSTEM "chrome://trackmenot/locale/trackmenot.dtd">
|
||||
<!--persist="screenX screenY width height" -->
|
||||
<window id="TRACKMENOT-editor"
|
||||
title="TRACKMENOT"
|
||||
onload="TRACKMENOT.editor._loadEntryWindow(window.arguments[0]);"
|
||||
orient="vertical"
|
||||
autostretch="always"
|
||||
|
||||
height="110px"
|
||||
width="470px"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/x-javascript" src="utils.js"/>
|
||||
<script type="application/x-javascript" src="editor.js"/>
|
||||
|
||||
|
||||
<vbox align="center">
|
||||
<groupbox width="460" flex="1">
|
||||
<caption label="Entry"/>
|
||||
<hbox align="center">
|
||||
<label value="Name" id='entry-label' control="entry-text" width="50" />
|
||||
<textbox id="entry-text" size="30" width="250" flex="1" />
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<hbox align="end" flex="1">
|
||||
<button label="OK" size="10" width="50" oncommand="TRACKMENOT.editor._saveEntryChange(window.arguments[0]);window.close();" />
|
||||
<button label="Cancel" size="10" width="50" oncommand="window.close();" />
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
361
editor.js
Executable file
|
@ -0,0 +1,361 @@
|
|||
|
||||
|
||||
|
||||
if(!TRACKMENOT) var TRACKMENOT = {};
|
||||
|
||||
TRACKMENOT.editor = function () {
|
||||
|
||||
var rss_file = null;
|
||||
var rss_seed = null;
|
||||
var rss_obj = null;
|
||||
var tree_state = '';
|
||||
var tree_item = '';
|
||||
var new_feed_uri = '';
|
||||
|
||||
function appendCellToTree(tr,label) {
|
||||
var treeCellName = document.createElement("treecell");
|
||||
treeCellName.setAttribute("label",label.toString());
|
||||
tr.appendChild(treeCellName);
|
||||
}
|
||||
|
||||
function getRunningWindow() {
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Components.interfaces.nsIWindowMediator);
|
||||
var en = wm.getEnumerator("navigator:browser");
|
||||
while (en.hasMoreElements()) {
|
||||
var win = en.getNext();
|
||||
if (win.TRACKMENOT && win.TRACKMENOT.gTrackMeNot)
|
||||
return win;
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
function cout(msg) {
|
||||
var win = getRunningWindow();
|
||||
win.TRACKMENOT.utils.cout(msg);
|
||||
}
|
||||
|
||||
function appendCatToTree( cat, tr) {
|
||||
if(cat.id)
|
||||
appendCellToTree(tr,cat.id);
|
||||
if(cat.type)
|
||||
appendCellToTree(tr,cat.type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createCellElement(fatherElement, elt, id, _window, isRoot, type ) {
|
||||
try {
|
||||
var ti = _window.document.createElement("treeitem");
|
||||
if (elt.children && elt.children.length > 0)
|
||||
ti.setAttribute("container", true);
|
||||
if (!isRoot && type && elt.type != type)
|
||||
ti.setAttribute("hidden", true);
|
||||
//ti.setAttribute("id", id++);
|
||||
var tr = _window.document.createElement("treerow");
|
||||
appendCatToTree(elt, tr)
|
||||
ti.setAttribute("open", isRoot);
|
||||
ti.appendChild(tr);
|
||||
if (elt.children) {
|
||||
var pch = _window.document.createElement("treechildren");
|
||||
for (var k = 0; k < elt.children.length; k++) {
|
||||
createCellElement(pch, elt.children[k], id, _window, false, type)
|
||||
}
|
||||
ti.appendChild(pch);
|
||||
}
|
||||
fatherElement.appendChild(ti);
|
||||
} catch (ex) {
|
||||
cout("Can't create cell element: " + ex)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function resetTree (id,_window) {
|
||||
var tree = _window.document.getElementById(id);
|
||||
var removeList = _window.document.getElementsByTagName("treechildren");
|
||||
while( removeList.length!= 0) {
|
||||
removeList = _window.document.getElementsByTagName("treechildren");
|
||||
for (var i=0; i< removeList.length; i++)
|
||||
tree.removeChild(removeList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function treeLoad (treeName,_window,type) {
|
||||
var win = getRunningWindow();
|
||||
var tree = _window.document.getElementById(treeName);
|
||||
if ( !tree ) {
|
||||
cout('Can not find tree');
|
||||
return;
|
||||
}
|
||||
resetTree(treeName,_window);
|
||||
var root = _window.document.createElement("treechildren");
|
||||
createCellElement(root, rss_obj, 0, _window, true,type );
|
||||
tree.appendChild(root);
|
||||
}
|
||||
|
||||
function getRSSFile() {
|
||||
if (rss_file!= null) return rss_file;
|
||||
rss_file = TRACKMENOT.utils.getProfileDir().clone();
|
||||
rss_file.append("TRACKMENOT");
|
||||
if( !rss_file.exists() || !rss_file.isDirectory() )
|
||||
rss_file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777);
|
||||
rss_file.append('TMNRss');
|
||||
return rss_file;
|
||||
}
|
||||
|
||||
function getRSSJsonString() {
|
||||
try {
|
||||
var file = getRSSFile();
|
||||
var data = "";
|
||||
var fstream = Components.classes["@mozilla.org/network/file-input-stream;1"]
|
||||
.createInstance(Components.interfaces.nsIFileInputStream);
|
||||
var sstream = Components.classes["@mozilla.org/scriptableinputstream;1"]
|
||||
.createInstance(Components.interfaces.nsIScriptableInputStream);
|
||||
fstream.init(file, -1, 0, 0);
|
||||
sstream.init(fstream);
|
||||
|
||||
var str = sstream.read(4096);
|
||||
while (str.length > 0) {
|
||||
data += str;
|
||||
str = sstream.read(4096);
|
||||
}
|
||||
|
||||
sstream.close();
|
||||
fstream.close();
|
||||
} catch (ex) {
|
||||
data = '{"id":"TMN RSS","type":"root","children":[{"id":"Sport","type":"category","children":[{"id":"http://sports-ak.espn.go.com/espn/rss/news","type":"RSS"}]},{"id":"News","type":"category","children":[{"id":"http://rss.cnn.com/rss/cnn_latest.rss","type":"RSS"}]},{"id":"IT","type":"category","children":[{"id":"http://rss.slashdot.org/Slashdot/slashdot","type":"RSS"}]},{"id":"Entertainment","type":"category","children":[{"id":"http://rss.imdb.com/news/","type":"RSS"}]}]}';
|
||||
}
|
||||
if ( data.length < 10 || data =='null' )
|
||||
data = '{"id":"TMN RSS","type":"root","children":[{"id":"Sport","type":"category","children":[{"id":"http://sports-ak.espn.go.com/espn/rss/news","type":"RSS"}]},{"id":"News","type":"category","children":[{"id":"http://rss.cnn.com/rss/cnn_latest.rss","type":"RSS"}]},{"id":"IT","type":"category","children":[{"id":"http://rss.slashdot.org/Slashdot/slashdot","type":"RSS"}]},{"id":"Entertainment","type":"category","children":[{"id":"http://rss.imdb.com/news/","type":"RSS"}]}]}';
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
function setIntPreference(prefName,prefValue) {
|
||||
if ( document.getElementById(prefValue) && document.getElementById(prefValue).value!= "" )
|
||||
this.prefs.setIntPref(prefName,document.getElementById(prefValue).value);
|
||||
}
|
||||
|
||||
function getObjectByID( id, father ) {
|
||||
var result = null;
|
||||
for each(var elt in father.children ) {
|
||||
if (elt.id == id) result = elt;
|
||||
else result = getObjectByID( id,elt);
|
||||
if( result != null) return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getFatherByID( id, father ) {
|
||||
var result = null;
|
||||
for each(var elt in father.children ) {
|
||||
if (elt.id == id) result = father;
|
||||
else result = getFatherByID( id,elt);
|
||||
if( result != null) return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function newCategory ( val, type) {
|
||||
var entr = {};
|
||||
entr.id = val;
|
||||
entr.type = type;
|
||||
entr.children = new Array();
|
||||
return entr;
|
||||
}
|
||||
|
||||
function newRSS(url,parent) {
|
||||
var entr = {};
|
||||
entr.id = url;
|
||||
entr.type = "RSS";
|
||||
return entr;
|
||||
}
|
||||
|
||||
function getFeedURL() {
|
||||
var searched = document.location.search.substr(1);
|
||||
var uriArray = searched.split("tmn_feed=");
|
||||
return decodeURIComponent(uriArray[1]);
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
_loadTree : function(reload) {
|
||||
if (!rss_obj || reload) TRACKMENOT.editor._loadRSS();
|
||||
treeLoad('tree-rss',window);
|
||||
},
|
||||
|
||||
_loadCategoryTree : function(reload) {
|
||||
if (!rss_obj || reload) TRACKMENOT.editor._loadRSS();
|
||||
treeLoad('tree-rss',window,'category');
|
||||
},
|
||||
|
||||
_loadRSS : function () {
|
||||
var rss = getRSSJsonString();
|
||||
rss_obj = JSON.parse(rss);
|
||||
},
|
||||
|
||||
|
||||
_addRSS : function () {
|
||||
var rss = getRSSJsonString();
|
||||
rss_obj = JSON.parse(rss);
|
||||
},
|
||||
|
||||
_addCategory : function () {
|
||||
var rss = getRSSJsonString();
|
||||
var rss_obj = JSON.parse(rss);
|
||||
},
|
||||
|
||||
_deleteRSS : function () {
|
||||
var rss = getObjectByID(tree_item,rss_obj);
|
||||
rss_obj.delete(rss);
|
||||
},
|
||||
|
||||
_deleteItem: function () {
|
||||
var tree = document.getElementById('tree-rss');
|
||||
var entry = tree.view.getCellText(tree.currentIndex,tree.columns.getColumnAt(0));
|
||||
var cat = getObjectByID(entry,rss_obj);
|
||||
var father = getFatherByID(entry,rss_obj);
|
||||
var catIndex = father.children.indexOf(cat);
|
||||
father.children.splice(catIndex,1);
|
||||
TRACKMENOT.editor._saveRSS();
|
||||
TRACKMENOT.editor._loadTree();
|
||||
},
|
||||
|
||||
_getRSS : function () {
|
||||
var rss = getRSSJsonString();
|
||||
rss_obj = JSON.parse(rss);
|
||||
},
|
||||
|
||||
_addEntry : function () {
|
||||
var entry = document.getElementById('text-entry').value;
|
||||
switch (tree_state) {
|
||||
case 'root' :
|
||||
rss_obj.children.push(newCategory(entry,'category'));
|
||||
break;
|
||||
case 'category':
|
||||
var cat = getObjectByID(tree_item,rss_obj);
|
||||
cat.children.push(newRSS(entry))
|
||||
break;
|
||||
case 'rss':
|
||||
var cat = getObjectByID(tree_item,rss_obj);
|
||||
cat.children.push(newRSS(entry))
|
||||
break;
|
||||
default :
|
||||
rss_obj.children.push(newCategory(entry,'category'));
|
||||
break;
|
||||
}
|
||||
TRACKMENOT.editor._saveRSS();
|
||||
TRACKMENOT.editor._loadTree();
|
||||
},
|
||||
|
||||
_getObjByType: function( obj, type, result) {
|
||||
for each(var elt in obj.children ) {
|
||||
if (elt.type == type) result.push(elt);
|
||||
TRACKMENOT.editor._getObjByType( elt, type, result);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
_getRSSObj: function () {
|
||||
if (!rss_obj) TRACKMENOT.editor._loadRSS();
|
||||
return rss_obj;
|
||||
},
|
||||
|
||||
_setRSSObj: function (str) {
|
||||
rss_obj = str ;
|
||||
TRACKMENOT.editor._saveRSS();
|
||||
} ,
|
||||
|
||||
_edit : function() {
|
||||
var tree = document.getElementById('tree-rss');
|
||||
var id = tree.view.getCellText(tree.currentIndex,tree.columns.getColumnAt(0));
|
||||
window.openDialog("chrome://trackmenot/content/editeentry.xul", "trackmenotEditeEntry", "chrome,dialog,centerscreen,alwaysRaised",id);
|
||||
},
|
||||
|
||||
_loadEntryWindow : function(id) {
|
||||
window.document.getElementById('entry-text').value = id;
|
||||
rss_obj = window.opener.TRACKMENOT.editor._getRSSObj();
|
||||
},
|
||||
|
||||
_saveEntryChange: function(old_id) {
|
||||
var obj = getObjectByID(old_id,rss_obj);
|
||||
obj.id = window.document.getElementById('entry-text').value;
|
||||
window.opener.TRACKMENOT.editor._setRSSObj(rss_obj)
|
||||
window.opener.TRACKMENOT.editor._loadTree();
|
||||
return;
|
||||
},
|
||||
|
||||
_updateTextLabel : function () {
|
||||
var win = getRunningWindow();
|
||||
if (!win ) return;
|
||||
var tree = document.getElementById('tree-rss');
|
||||
var sel = tree.view.selection.currentIndex; //returns -1 if the tree is not focused
|
||||
var treeItem = tree.view.getItemAtIndex(sel);
|
||||
var eltType = treeItem.childNodes[0].childNodes[1].getAttribute('label');
|
||||
tree_state = eltType;
|
||||
tree_item = treeItem.childNodes[0].childNodes[0].getAttribute('label') ;
|
||||
switch (eltType) {
|
||||
case 'root' :
|
||||
document.getElementById('entry-label').value = 'Category';
|
||||
document.getElementById("add-entry").label = 'Add Category';
|
||||
break;
|
||||
case 'category':
|
||||
document.getElementById('entry-label').value = 'RSS';
|
||||
document.getElementById("add-entry").label = 'Add RSS';
|
||||
break;
|
||||
case 'rss':
|
||||
document.getElementById('entry-label').value = 'RSS';
|
||||
document.getElementById("add-entry").label = 'Add RSS';
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_onFeedPageLoad :function() {
|
||||
new_feed_uri = getFeedURL();
|
||||
if (new_feed_uri != "") {
|
||||
cout("Adding new feed: "+ new_feed_uri);
|
||||
openDialog("chrome://trackmenot/content/selectcat.xul", "TrackMeNot RSS Handler","chrome,centerscreen,resizable=yes,width=230,height=250",new_feed_uri)
|
||||
}
|
||||
return;
|
||||
},
|
||||
|
||||
_onSelectTopicLoad: function(e) {
|
||||
TRACKMENOT.editor._loadCategoryTree();
|
||||
var attributes = new Array ('text')
|
||||
if("arguments" in window && window.arguments.length > 0) {
|
||||
new_feed_uri = window.arguments[0];
|
||||
cout("Selecting a topic for feed: "+ new_feed_uri);
|
||||
}
|
||||
return;
|
||||
},
|
||||
|
||||
_addFlowToTopic: function() {
|
||||
var win = getRunningWindow();
|
||||
var tree = document.getElementById("tree-rss");
|
||||
var sel = tree.view.selection.currentIndex; //returns -1 if the tree is not focused
|
||||
var treeItem = tree.view.getItemAtIndex(sel);
|
||||
var cat_text = treeItem.childNodes[0].childNodes[0].getAttribute('label') ;
|
||||
cout("Feed " + new_feed_uri + "\n is going to be added to category: "+cat_text);
|
||||
if (!rss_obj) TRACKMENOT.editor._loadRSS();
|
||||
var cat = getObjectByID(cat_text,rss_obj);
|
||||
cat.children.push(newRSS(new_feed_uri));
|
||||
TRACKMENOT.editor._saveRSS();
|
||||
},
|
||||
|
||||
_saveRSS : function () {
|
||||
var file = getRSSFile();
|
||||
var foStream = TRACKMENOT.utils.getFoStream();
|
||||
foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0);
|
||||
var jsonString = JSON.stringify(rss_obj);
|
||||
cout(jsonString)
|
||||
foStream.write(jsonString, jsonString.length,'','iso-8859-1');
|
||||
foStream.close();
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
}();
|
73
editor.xul
Executable file
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<!DOCTYPE overlay SYSTEM "chrome://trackmenot/locale/trackmenot.dtd">
|
||||
<!--persist="screenX screenY width height" -->
|
||||
<window id="TRACKMENOT-editor"
|
||||
title="TRACKMENOT"
|
||||
onload="TRACKMENOT.editor._loadTree(false);"
|
||||
orient="vertical"
|
||||
autostretch="always"
|
||||
|
||||
height="470px"
|
||||
width="600px"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/x-javascript" src="utils.js"/>
|
||||
<script type="application/x-javascript" src="editor.js"/>
|
||||
|
||||
<hbox flex="1">
|
||||
<vbox width="160" height="230" flex="1">
|
||||
<tree id="tree-rss" flex="1" width="160" onmouseup="TRACKMENOT.editor._updateTextLabel()" >
|
||||
|
||||
<treecols >
|
||||
<treecol id="elt-name" label="Category" width="70%" primary="true" flex="1" />
|
||||
<treecol id="elt-type" label="type" width="30%" flex="1" />
|
||||
</treecols>
|
||||
</tree>
|
||||
</vbox>
|
||||
<vbox width="20" align="center">
|
||||
<button id="cat-del" label="Delete" size="20" oncommand="TRACKMENOT.editor._deleteItem();TRACKMENOT.editor._loadTree(false);" />
|
||||
<button id="cat-show" label="Edit" size="20" oncommand="TRACKMENOT.editor._edit();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
<vbox align="center">
|
||||
<groupbox width="460" flex="1">
|
||||
<caption label="Entry"/>
|
||||
<hbox align="center">
|
||||
<label value="Category" id='entry-label' control="text-entry" width="50" />
|
||||
<textbox id="text-entry" size="30" width="250" flex="1" onmouseup="TRACKMENOT.editor._updateTextLabel();"/>
|
||||
<vbox align="end" flex="1">
|
||||
<button id="add-entry" label="Add Category" size="10" width="90" oncommand="TRACKMENOT.editor._addEntry();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<vbox align="end" flex="1">
|
||||
<button id="edit-close" label="OK" size="10" oncommand="TRACKMENOT.editor._saveRSS();window.close();" />
|
||||
</vbox>
|
||||
|
||||
</vbox>
|
||||
|
||||
<!--<groupbox width="160" flex="1" >
|
||||
<caption label="Properties"/>
|
||||
<vbox align="left">
|
||||
<hbox align="center">
|
||||
<label value="Count" control="cat-count" />
|
||||
<scale id="cat-count" min="1" max="500" width="300" onchange="TRACKMENOT.editor._modifyScale(event);" onmouseup="TRACKMENOT.editor._edite();TRACKMENOT.editor._loadTree();"/>
|
||||
<label id="cat-count-value" />
|
||||
</hbox>
|
||||
<hbox align="center" hidden="true">
|
||||
<label value="Time" control="cat-time" />
|
||||
<scale id="cat-time" min="1" max="500" width="300" onchange="TRACKMENOT.editor._modifyScale(event);"/>
|
||||
<label id="cat-time-value" />
|
||||
</hbox>
|
||||
<hbox align="center" hidden="true">
|
||||
<label value="Click" control="cat-click" />
|
||||
<scale id="cat-click" min="1" max="500" width="300" onchange="TRACKMENOT.editor._modifyScale(event);"/>
|
||||
<label id="cat-click-value" />
|
||||
</hbox>
|
||||
</vbox>
|
||||
<vbox align="center">
|
||||
<button label="Update" oncommand="TRACKMENOT.editor.edite();TRACKMENOT.editor._loadTree();" />
|
||||
</vbox>
|
||||
</groupbox> -->
|
||||
</window>
|
BIN
images/TMN_header.gif
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
images/TMN_logo.gif
Executable file
After Width: | Height: | Size: 10 KiB |
BIN
images/left_frame.gif
Executable file
After Width: | Height: | Size: 686 B |
BIN
images/skin/about_icon.png
Executable file
After Width: | Height: | Size: 872 B |
BIN
images/skin/help_icon.png
Executable file
After Width: | Height: | Size: 801 B |
BIN
images/skin/info_icon.png
Executable file
After Width: | Height: | Size: 3.5 KiB |
BIN
images/skin/off_icon.png
Executable file
After Width: | Height: | Size: 1 KiB |
BIN
images/skin/on_icon.png
Executable file
After Width: | Height: | Size: 832 B |
BIN
images/skin/option_icon.png
Executable file
After Width: | Height: | Size: 578 B |
BIN
images/skin/tmn.png
Executable file
After Width: | Height: | Size: 2.5 KiB |
BIN
images/skin/tmn_icon.png
Executable file
After Width: | Height: | Size: 1.1 KiB |
BIN
images/skin/tmn_lg.png
Executable file
After Width: | Height: | Size: 9.7 KiB |
BIN
images/tobespacer.gif
Executable file
After Width: | Height: | Size: 265 B |
6
jquery.js
vendored
Executable file
35
locale/da-DK.properties
Executable file
|
@ -0,0 +1,35 @@
|
|||
tmn.rss.validate=Godkend
|
||||
tmn.rss.use-defaults=Brug Standard
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
||||
trackmenot= TrackMeNot
|
||||
tmn.menu.enabled= Slået Til
|
||||
tmn.menu.options= Indstillinger
|
||||
tmn.menu.help= Hjælp
|
||||
tmn.menu.about= Om
|
||||
tmn.option.help.faq= Hjælp/FAQ
|
||||
tmn.option.searchengines= Søgemaskiner
|
||||
tmn.option.show.queries= Vis Forespørgsler
|
||||
tmn.option.current.queries= Kørende Forespørgsler
|
||||
tmn.option.enabled= Slaet Til
|
||||
tmn.option.show.status= Show Status
|
||||
tmn.option.ctrl.click= Ctrl-Klik for flere valg:
|
||||
tmn.option.select.all= Vælg Alle
|
||||
tmn.option.clear.all= Fravælg Alle
|
||||
tmn.option.enable.burst= Slå Forespørgsler Til
|
||||
tmn.option.query.freq= Gns. Forespørgselsrate
|
||||
tmn.option.avg.queries= Antal Forespørgsler
|
||||
tmn.option.freq.10pm= 10 pr min
|
||||
tmn.option.freq.5pm= 5 pr min
|
||||
tmn.option.freq.1pm= 1 pr min
|
||||
tmn.option.freq.30ph= 30 pr time
|
||||
tmn.option.freq.10ph= 10 pr time
|
||||
tmn.option.freq.1ph= 1 pr time
|
||||
tmn.option.logging= Log Indstillinger
|
||||
tmn.option.log.show= Vis Log
|
||||
tmn.option.log.clear= Slet Log
|
||||
tmn.option.cookies= Cookie Håndtering
|
||||
tmn.option.rss.validate= Godkend
|
||||
tmn.option.rss.useDefaults= Brug Standard
|
||||
tmn.option.rss.caption= RSS feeds der benyttes til forespørgsler (komma-separeret)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords (comma-separated)
|
||||
tmn.about.danish= Dansk oversaettelse af Tommy Mejldal
|
33
locale/de-DE.properties
Executable file
|
@ -0,0 +1,33 @@
|
|||
trackmenot= TrackMeNot
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
||||
tmn.menu.enabled= Einschalten
|
||||
tmn.menu.options= Optionen
|
||||
tmn.menu.help= Hilfe
|
||||
tmn.menu.about= About
|
||||
tmn.option.help.faq= Hilfe/FAQ
|
||||
tmn.option.searchengines= Suchmaschinen
|
||||
tmn.option.show.queries= Suchanfrage anzeigen
|
||||
tmn.option.current.queries= Aktuelle Suchbegriffe
|
||||
tmn.option.enabled= Einschalten
|
||||
tmn.option.show.status= Status anzeigen
|
||||
tmn.option.ctrl.click= Strg f\u00c3\u00bcr Mehrfachauswahl gedr\u00c3\u00bcckt halten
|
||||
tmn.option.select.all= Alles ausw\u00c3\u00a4hlen
|
||||
tmn.option.clear.all= Nichts ausw\u00c3\u00a4hlen
|
||||
tmn.option.enable.burst= Suchanfragen unregelm\u00c3\u00a4\u00c3\u009fig senden
|
||||
tmn.option.query.freq= Rate der Suchanfragen
|
||||
tmn.option.avg.queries= Frequenz der Suchanfragen
|
||||
tmn.option.freq.10pm= 10 pro Minute
|
||||
tmn.option.freq.5pm= 5 pro Minute
|
||||
tmn.option.freq.1pm= 1 pro Minute
|
||||
tmn.option.freq.30ph= 30 pro Stunde
|
||||
tmn.option.freq.10ph= 10 pro Stunde
|
||||
tmn.option.freq.1ph= 1 pro Stunde
|
||||
tmn.option.logging= Logging Optionen
|
||||
tmn.option.log.show= Log zeigen
|
||||
tmn.option.log.clear= Log l\u00c3\u00b6schen
|
||||
tmn.option.cookies= G\u00c3\u00a9rer le Cookie
|
||||
tmn.option.rss.validate= Valider
|
||||
tmn.option.rss.useDefaults= Use Defaults
|
||||
tmn.option.rss.caption= RSS-Feeds um die Suchbegriff-Liste zu initialisieren (durch Kommas getrennt)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords (comma-separated)
|
||||
tmn.about.danish= Danish translation by Tommy Mejldal
|
35
locale/en-US.properties
Executable file
|
@ -0,0 +1,35 @@
|
|||
tmn.rss.validate=Validate
|
||||
tmn.rss.use-defaults=Use Defaults
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
||||
trackmenot= TrackMeNot
|
||||
tmn.menu.enabled= Enabled
|
||||
tmn.menu.options= Options
|
||||
tmn.menu.help= Help
|
||||
tmn.menu.about= About
|
||||
tmn.option.help.faq= Help/FAQ
|
||||
tmn.option.searchengines= Search Engines
|
||||
tmn.option.show.queries= Show Queries
|
||||
tmn.option.current.queries= Current Queries
|
||||
tmn.option.enabled= Enabled
|
||||
tmn.option.show.status= Show Status
|
||||
tmn.option.ctrl.click= Ctrl-Click for multiple selections:
|
||||
tmn.option.select.all= Select All
|
||||
tmn.option.clear.all= Clear All= >
|
||||
tmn.option.enable.burst= Enable Query Bursts
|
||||
tmn.option.query.freq= Avg. Query Rate:
|
||||
tmn.option.avg.queries= Query Frequency
|
||||
tmn.option.freq.10pm= 10 per min
|
||||
tmn.option.freq.5pm= 5 per min
|
||||
tmn.option.freq.1pm= 1 per min
|
||||
tmn.option.freq.30ph= 30 per hour
|
||||
tmn.option.freq.10ph= 10 per hour
|
||||
tmn.option.freq.1ph= 1 per hour
|
||||
tmn.option.logging= Logging Options
|
||||
tmn.option.log.show= Show Log
|
||||
tmn.option.log.clear= Clear Log
|
||||
tmn.option.cookies= Cookie Handling
|
||||
tmn.option.rss.validate= Validate
|
||||
tmn.option.rss.useDefaults= Use Defaults
|
||||
tmn.option.rss.caption= RSS feeds used to initialize the query list(pipe-separated)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords (comma-separated)
|
||||
tmn.about.danish= Danish translation by Tommy Mejldal
|
34
locale/fr-FR.properties
Executable file
|
@ -0,0 +1,34 @@
|
|||
trackmenot= TrackMeNot
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
||||
tmn.menu.enabled= Activé
|
||||
tmn.menu.options= Options
|
||||
tmn.menu.help= Aide
|
||||
tmn.menu.about= A Propos
|
||||
tmn.option.help.faq= Aide/FAQ
|
||||
tmn.option.searchengines= Moteurs de Recherches
|
||||
tmn.option.show.queries= Afficher les requêtes
|
||||
tmn.option.current.queries= Requêtes courante
|
||||
tmn.option.enabled= Activé
|
||||
tmn.option.show.status= Montrer l'Etat
|
||||
tmn.option.ctrl.click= Ctrl-Click pour des sélections multiples:
|
||||
tmn.option.select.all= Tout Sélectionner
|
||||
tmn.option.clear.all= Tout Effacer
|
||||
tmn.option.enable.burst= Activer le mode rafale
|
||||
tmn.option.query.freq= Taux Moyen des Req:
|
||||
tmn.option.avg.queries= Fréquence des Requêtes
|
||||
tmn.option.freq.10pm= 10 par min
|
||||
tmn.option.freq.5pm= 5 par min
|
||||
tmn.option.freq.1pm= 1 par min
|
||||
tmn.option.freq.30ph= 30 par heure
|
||||
tmn.option.freq.10ph= 10 par heure
|
||||
tmn.option.freq.1ph= 1 par heure
|
||||
tmn.option.logging= Options Logging
|
||||
tmn.option.log.show= Voir Log
|
||||
tmn.option.log.clear= Effacer Log
|
||||
tmn.option.cookies= Gérer le Cookie
|
||||
tmn.option.rss.validate= Valider
|
||||
tmn.option.rss.feeds= Flux:
|
||||
tmn.option.rss.reset= Reset
|
||||
tmn.option.rss.caption= Flux RSS utilisé pour initialiser les mots clés (séparés par des trais verticaux)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords(comma-separated)
|
||||
tmn.option.clean.cookies= Vider le Cookie (Anonymize les Cookies SEULEMENT pour les recherches)
|
35
locale/hr-HR.properties
Executable file
|
@ -0,0 +1,35 @@
|
|||
trackmenot= TrackMeNot
|
||||
tmn.menu.enabled= Omoguceno
|
||||
tmn.menu.options= Opcije
|
||||
tmn.menu.help= Pomoc
|
||||
tmn.menu.about= O programu
|
||||
tmn.option.help.faq= Pomoc/FAQ
|
||||
tmn.option.searchengines= Tražilice
|
||||
tmn.option.show.queries= Prikaži upite
|
||||
tmn.option.current.queries= Trenutni upiti
|
||||
tmn.option.enabled= Omoguceno
|
||||
tmn.option.show.status= Prikaži status
|
||||
tmn.option.ctrl.click= Ctrl-Klikni za višestruki izbor
|
||||
tmn.option.select.all= Odaberi sve
|
||||
tmn.option.clear.all= Izbriši sve
|
||||
tmn.option.enable.burst= Omoguci "prasak" upita
|
||||
tmn.option.query.freq= Prosjecni broj upita
|
||||
tmn.option.avg.queries= Frekvencija upita
|
||||
tmn.option.freq.10pm= 10/min
|
||||
tmn.option.freq.5pm= 5/min
|
||||
tmn.option.freq.1pm= 1/min
|
||||
tmn.option.freq.30ph= 30/sat
|
||||
tmn.option.freq.10ph= 10/sat
|
||||
tmn.option.freq.1ph= 1/sat
|
||||
tmn.option.logging= Opcije prijave
|
||||
tmn.option.log.show= Prikaži zapis
|
||||
tmn.option.log.clear= Obriši zapis
|
||||
tmn.option.cookies= Rad s kolacicima
|
||||
tmn.option.rss.validate= Potvrdi
|
||||
tmn.option.rss.useDefaults= Koristi zadane postavke
|
||||
tmn.option.rss.caption= RRS feedovi korišteni za pokretanje upitne liste (odvojeni zarezom)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords (comma-separated)
|
||||
tmn.about.danish= Prijevod na danski - Tommy Mejldal
|
||||
tmn.rss.validate=Potvrdi
|
||||
tmn.rss.use-defaults=Koristi zadane postavke
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
35
locale/nl-NL.properties
Executable file
|
@ -0,0 +1,35 @@
|
|||
tmn.rss.validate=Valideren
|
||||
tmn.rss.use-defaults=Standaardinstellingen gebruiken
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
||||
trackmenot= TrackMeNot
|
||||
tmn.menu.enabled= Ingeschakeld
|
||||
tmn.menu.options= Opties
|
||||
tmn.menu.help= Help
|
||||
tmn.menu.about= Over
|
||||
tmn.option.help.faq= Help/Veelgestelde vragen
|
||||
tmn.option.searchengines= Zoekmachines
|
||||
tmn.option.show.queries= Zoekopdrachten weergeven
|
||||
tmn.option.current.queries= Huidige zoekopdrachten
|
||||
tmn.option.enabled= Ingeschakeld
|
||||
tmn.option.show.status= Status weergeven
|
||||
tmn.option.ctrl.click= Ctrl-klik voor meerdere selecties:
|
||||
tmn.option.select.all= Alles selecteren
|
||||
tmn.option.clear.all= Alles wissen
|
||||
tmn.option.enable.burst= Zoekopdrachtbursts inschakelen
|
||||
tmn.option.query.freq= Gem. zoekopdrachtsnelheid:
|
||||
tmn.option.avg.queries= Zoekopdrachtfrequentie
|
||||
tmn.option.freq.10pm= 10 per min
|
||||
tmn.option.freq.5pm= 5 per min
|
||||
tmn.option.freq.1pm= 1 per min
|
||||
tmn.option.freq.30ph= 30 per uur
|
||||
tmn.option.freq.10ph= 10 per uur
|
||||
tmn.option.freq.1ph= 1 per uur
|
||||
tmn.option.logging= Logopties
|
||||
tmn.option.log.show= Logbestand weergeven
|
||||
tmn.option.log.clear= Logbestand wissen
|
||||
tmn.option.cookies= Cookiebehandeling
|
||||
tmn.option.rss.validate= Valideren
|
||||
tmn.option.rss.useDefaults= Standaardinstellingen gebruiken
|
||||
tmn.option.rss.caption= Gebruikte RSS-feeds om de zoekopdrachtlijst te initialiseren (pipe-separated)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords (comma-separated)
|
||||
tmn.about.danish= Nederlandse vertaling door markh van BabelZilla.org
|
35
locale/pt-BR.properties
Executable file
|
@ -0,0 +1,35 @@
|
|||
tmn.rss.validate=Validar
|
||||
tmn.rss.use-defaults=Usar Valores Padrão
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
||||
trackmenot= TrackMeNot
|
||||
tmn.menu.enabled= Ativado
|
||||
tmn.menu.options= Opções
|
||||
tmn.menu.help= Ajuda
|
||||
tmn.menu.about= Sobre
|
||||
tmn.option.help.faq= Ajuda/FAQ
|
||||
tmn.option.searchengines= Motores de Busca
|
||||
tmn.option.show.queries= Mostrar Termos de Busca
|
||||
tmn.option.current.queries= Termos de Busca Atuais
|
||||
tmn.option.enabled= Ativado
|
||||
tmn.option.show.status= Mostrar Status
|
||||
tmn.option.ctrl.click= Ctrl-Clique para seleções múltiplas:
|
||||
tmn.option.select.all= Selecionar Tudo
|
||||
tmn.option.clear.all= Limpar Tudo
|
||||
tmn.option.enable.burst= Ativar Propagação de Termos de Busca
|
||||
tmn.option.query.freq= Taxa Média de Termos de Busca:
|
||||
tmn.option.avg.queries= Freqüência de Termos de Busca
|
||||
tmn.option.freq.10pm= 10 por minuto
|
||||
tmn.option.freq.5pm= 5 por minuto
|
||||
tmn.option.freq.1pm= 1 por minuto
|
||||
tmn.option.freq.30ph= 30 por hora
|
||||
tmn.option.freq.10ph= 10 por hora
|
||||
tmn.option.freq.1ph= 1 por hora
|
||||
tmn.option.logging= Opções de Registro
|
||||
tmn.option.log.show= Mostrar Registro
|
||||
tmn.option.log.clear= Limpar Registro
|
||||
tmn.option.cookies= Manuseio de Cookies
|
||||
tmn.option.rss.validate= Validação
|
||||
tmn.option.rss.useDefaults= Usar Valores Padrão
|
||||
tmn.option.rss.caption= Fontes RSS usadas para iniciar uma lista de termos de busca (separados por pipe)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords (comma-separated)
|
||||
tmn.about.danish= Tradução para o Português do Brasil por Edgard Dias Magalhães (edgard.magalhaes@gmail.com)
|
35
locale/zh-CN.properties
Executable file
|
@ -0,0 +1,35 @@
|
|||
tmn.rss.validate=验证
|
||||
tmn.rss.use-defaults=使用默认数据
|
||||
tmn.rss.default-feeds=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml|http://rss.cnn.com/rss/cnn_topstories.rss|http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml|http://www.theregister.co.uk/headlines.rss
|
||||
trackmenot= TrackMeNot
|
||||
tmn.menu.enabled= 启用
|
||||
tmn.menu.options= 选项
|
||||
tmn.menu.help= 帮助
|
||||
tmn.menu.about= 关于
|
||||
tmn.option.help.faq= 帮助/常见问题解答
|
||||
tmn.option.searchengines= 搜索引擎
|
||||
tmn.option.show.queries= 显示查询
|
||||
tmn.option.current.queries= 当前查询
|
||||
tmn.option.enabled= 启用
|
||||
tmn.option.show.status= 显示状态
|
||||
tmn.option.ctrl.click= Ctrl-单击多选:
|
||||
tmn.option.select.all= 选择所有
|
||||
tmn.option.clear.all= 清除所有
|
||||
tmn.option.enable.burst= 启用突发查询
|
||||
tmn.option.query.freq= 查询平均速率:
|
||||
tmn.option.avg.queries= 查询频率
|
||||
tmn.option.freq.10pm= 每分钟10次
|
||||
tmn.option.freq.5pm= 每分钟5次
|
||||
tmn.option.freq.1pm= 每分钟1次
|
||||
tmn.option.freq.30ph= 每小时30次
|
||||
tmn.option.freq.10ph= 每小时10次
|
||||
tmn.option.freq.1ph= 每小时10次
|
||||
tmn.option.logging= 日志选项
|
||||
tmn.option.log.show= 显示日志
|
||||
tmn.option.log.clear= 清除日志
|
||||
tmn.option.cookies= Cookie 处理
|
||||
tmn.option.rss.validate= 验证
|
||||
tmn.option.rss.useDefaults= 使用默认数据
|
||||
tmn.option.rss.caption= RSS 订阅被用来初始化查询列表(逗号-分隔)
|
||||
tmn.option.kwBlackList.caption= List of black-listed keywords (comma-separated)
|
||||
tmn.about.danish= Danish translation by Tommy Mejldal
|
24
manifest.json
Executable file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "TrackMeNot",
|
||||
"version": "0.8.3",
|
||||
"description": "TMN portage on Chrome",
|
||||
"browser_action": {
|
||||
"default_icon": "tmn.png",
|
||||
"popup": "menu.html"
|
||||
},
|
||||
"background": "tmn_page.html",
|
||||
"options_page": "options.html",
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["http://*/*"],
|
||||
"js": ["tmn_search.js", "rep_processor.js"],
|
||||
"run_at": "document_start",
|
||||
"all_frames" : true
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
"tabs","http://*/*"
|
||||
]
|
||||
}
|
||||
|
57
menu-script.js
Executable file
|
@ -0,0 +1,57 @@
|
|||
var tmn = null;
|
||||
var tmn_option_query = '';
|
||||
var tmn_option_engine = '';
|
||||
var options = null;
|
||||
|
||||
|
||||
|
||||
$("#trackmenot-menu-useTab").click(toggleTabFrame);
|
||||
$("#trackmenot-enabled").click(toggleOnOff);
|
||||
$("#trackmenot-menu-help").click(showHelp);
|
||||
|
||||
function _cout (msg) { console.log(msg); }
|
||||
|
||||
function showHelp() {
|
||||
window.open("http://www.cs.nyu.edu/trackmenot/faq.html")
|
||||
}
|
||||
|
||||
|
||||
function toggleOnOff() {
|
||||
options.enabled = !options.enabled
|
||||
tmn_options = {"options":options};
|
||||
self.port.emit("TMNSaveOptions",tmn_options.options);
|
||||
loadMenu(tmn_options)
|
||||
}
|
||||
|
||||
function toggleTabFrame() {
|
||||
options.useTab = !options.useTab
|
||||
tmn_options = {"options":options};
|
||||
self.port.emit("TMNSaveOptions",tmn_options.options);
|
||||
loadMenu(tmn_options)
|
||||
}
|
||||
|
||||
$("#trackmenot-menu-win").click(function() {
|
||||
self.port.emit("TMNOpenOption")
|
||||
})
|
||||
|
||||
function loadMenu( panel_inputs) {
|
||||
|
||||
options = panel_inputs.options;
|
||||
if ( panel_inputs.query && panel_inputs.engine )
|
||||
$("#trackmenot-label").html(panel_inputs.engine + " '"+ panel_inputs.query+"'");
|
||||
|
||||
|
||||
if ( options.enabled) {
|
||||
$("#trackmenot-enabled").html('Disable');
|
||||
$("#trackmenot-img-enabled").attr("src", "images/skin/off_icon.png");
|
||||
} else {
|
||||
$("#trackmenot-enabled").html('Enable');
|
||||
$("#trackmenot-img-enabled").attr("src", "images/skin/on_icon.png");
|
||||
}
|
||||
|
||||
if (options.useTab) $("#trackmenot-menu-useTab").html('Stealth');
|
||||
else $("#trackmenot-menu-useTab").html('Tab')
|
||||
|
||||
}
|
||||
|
||||
self.port.on("TMNSendOption",loadMenu )
|
185
option-script.js
Executable file
|
@ -0,0 +1,185 @@
|
|||
|
||||
var tmn_options ={};
|
||||
|
||||
$("#apply-options").click( function() {
|
||||
tmn_options = {"options":saveOptions()};
|
||||
TMNSetOptionsMenu(tmn_options);
|
||||
alert("Configuration saved");
|
||||
self.port.emit("TMNSaveOptions",tmn_options.options);
|
||||
}
|
||||
);
|
||||
|
||||
$("#show-add").click( function() {
|
||||
$("#add-engine-table").show();
|
||||
}
|
||||
);
|
||||
$("#show-log").click( function() {
|
||||
self.port.emit("TMNOptionsShowLog");
|
||||
}
|
||||
);
|
||||
|
||||
$("#trackmenot-opt-showqueries").click( function() {
|
||||
self.port.emit("TMNOptionsShowQueries");
|
||||
}
|
||||
);
|
||||
|
||||
$("#validate-feed").click( function() {
|
||||
var feeds = $("#trackmenot-seed").val();
|
||||
var param = {"feeds": feeds}
|
||||
self.port.emit("TMNValideFeeds",param);
|
||||
}
|
||||
);
|
||||
|
||||
$("#clear-log").click( function() {
|
||||
self.port.emit("TMNOptionsClearLog");
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$("#search-engine-list").on('click', 'button.smallbutton', function(event) {
|
||||
var del_engine = event.target.id.split("_").pop();
|
||||
self.port.emit("TMNDelEngine",{'engine':del_engine});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#add-engine").click( function() {
|
||||
var engine = {}
|
||||
engine.name = $("#newengine-name").val();
|
||||
engine.urlmap = $("#newengine-map").val();
|
||||
if(engine.urlmap.indexOf('trackmenot') <0 ) {
|
||||
alert("Did not find 'trackmenot' in the URL")
|
||||
return
|
||||
}
|
||||
self.port.emit("TMNAddEngine",engine);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
function TMNSetOptionsMenu( tab_inputs) {
|
||||
var options = tab_inputs.options;
|
||||
var feedList = options.feedList;
|
||||
var kw_black_list = options.kw_black_list;
|
||||
console.log("Enabled: " +options.enabled)
|
||||
$("#add-engine-table").hide();
|
||||
$("#trackmenot-opt-enabled").prop('checked', options.enabled);
|
||||
$("#trackmenot-opt-useTab").prop('checked',options.useTab);
|
||||
$("#trackmenot-opt-burstMode").prop('checked',options.burstMode);
|
||||
$("#trackmenot-opt-save-logs").prop('checked',options.saveLogs);
|
||||
$("#trackmenot-opt-disable-logs").prop('checked',options.disableLogs);
|
||||
|
||||
$("#trackmenot-seed").val(feedList);
|
||||
$("#trackmenot-blacklist").val(kw_black_list);
|
||||
$("#trackmenot-use-blacklist").prop('checked', options.use_black_list);
|
||||
$("#trackmenot-use-dhslist").prop('checked', options.use_dhs_list);
|
||||
|
||||
var engines = options.searchEngines.split(',');
|
||||
for( var i=0; i< engines.length;i++)
|
||||
$("#"+engines[i]).prop('checked',true);
|
||||
|
||||
setFrequencyMenu(options.timeout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function setFrequencyMenu(timeout){
|
||||
var menu = $("#trackmenot-opt-timeout");
|
||||
$('#trackmenot-opt-timeout option[value=' +timeout+ ']').prop('selected', true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function TMNShowLog(tmnlogs) {
|
||||
var logs = tmnlogs.logs
|
||||
var htmlStr = '<table witdh=500 cellspacing=3 bgcolor=white frame=border>';
|
||||
htmlStr += '<thead><tr align=left>';
|
||||
htmlStr += '<th>Engine</th>';
|
||||
htmlStr += '<th>Mode</th>';
|
||||
htmlStr += '<th>URL</th>';
|
||||
htmlStr += '<th>Query/Message</th>';
|
||||
htmlStr += '<th>Date</th>';
|
||||
htmlStr += '</tr></thead>';
|
||||
for (var i=0; i< 3000 && i<logs.length ; i++) {
|
||||
htmlStr += '<tr ';
|
||||
if (logs[i].type == 'ERROR') htmlStr += 'style="color:Red">';
|
||||
if (logs[i].type == 'query') htmlStr += 'style="color:Black">';
|
||||
if (logs[i].type == 'URLmap') htmlStr += 'style="color:Brown">';
|
||||
if (logs[i].type == 'click') htmlStr += 'style="color:Blue">';
|
||||
if (logs[i].type == 'info') htmlStr += 'style="color:Green">';
|
||||
htmlStr += logs[i].engine ? '<td><b>' + logs[i].engine+ '</b></td>' : '<td></td>';
|
||||
htmlStr += logs[i].mode ? '<td>' + logs[i].mode+ '</td>' : '<td></td>';
|
||||
htmlStr += logs[i].newUrl ? '<td>' + logs[i].newUrl.substring(0,50) + '</td>' : '<td></td>';
|
||||
htmlStr += logs[i].query ? '<td>' + logs[i].query+ '</td>' : '<td></td>';
|
||||
htmlStr += logs[i].date ? '<td>' + logs[i].date+ '</td>' : '<td></td>';
|
||||
|
||||
htmlStr += '</font></tr>';
|
||||
}
|
||||
htmlStr += '</table>';
|
||||
$('#tmn_logs_container').html(htmlStr);
|
||||
}
|
||||
|
||||
|
||||
function TMNShowEngines(engines) {
|
||||
var htmlStr = "<table>";
|
||||
for (var i=0; i<engines.length ; i++) {
|
||||
var engine = engines[i];
|
||||
htmlStr += '<tr >';
|
||||
htmlStr += '<td><input type="checkbox" id="'+ engine.id +'" value="'+engine.id +'">'+ engine.name +'</td><td><button class="smallbutton" id="del_engine_'+engine.id+'" > - </button> </td>';
|
||||
htmlStr += '</tr>';
|
||||
}
|
||||
htmlStr += '</table>';
|
||||
$('#search-engine-list').html(htmlStr);
|
||||
}
|
||||
|
||||
function TMNShowQueries(param) {
|
||||
var queries = param.queries.split(',');
|
||||
var htmlStr = '<table witdh=500 cellspacing=3 bgcolor=white frame=border>';
|
||||
for (var i=0; i< 3000 && i<queries.length ; i++) {
|
||||
htmlStr += '<tr style="color:Black">';
|
||||
htmlStr += '<td>' +queries[i]+ '<td>'
|
||||
htmlStr += '</tr>';
|
||||
}
|
||||
htmlStr += '</table>';
|
||||
$('#tmn_logs_container').html(htmlStr);
|
||||
}
|
||||
|
||||
|
||||
function saveOptions() {
|
||||
var options = {};
|
||||
options.enabled = $("#trackmenot-opt-enabled").is(':checked');
|
||||
|
||||
console.log("Saved Enabled: "+options.enabled )
|
||||
options.useTab = $("#trackmenot-opt-useTab").is(':checked');
|
||||
options.burstMode = $("#trackmenot-opt-burstMode").is(':checked');
|
||||
options.disableLogs = $("#trackmenot-opt-disable-logs").is(':checked');
|
||||
options.saveLogs = $("#trackmenot-opt-save-logs").is(':checked');
|
||||
options.timeout = $("#trackmenot-opt-timeout").val();
|
||||
setFrequencyMenu(options.timeout);
|
||||
|
||||
var engines = '';
|
||||
var list = $("#search-engine-list:checked");
|
||||
$("#search-engine-list :checked").each(function(){engines+=($(this).val())+","})
|
||||
if (engines.length>0)
|
||||
engines=engines.substring(0,engines.length-1);
|
||||
|
||||
options.searchEngines = engines;
|
||||
options.feedList = $("#trackmenot-seed").val();
|
||||
options.use_black_list = $("#trackmenot-use-blacklist").is(':checked');
|
||||
options.use_dhs_list = $("#trackmenot-use-dhslist").is(':checked');
|
||||
options.kw_black_list = $("#trackmenot-blacklist").val();
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
|
||||
self.port.on("TMNSetOptionsMenu",TMNSetOptionsMenu)
|
||||
self.port.on("TMNSendLogs",TMNShowLog)
|
||||
self.port.on("TMNSendQueries",TMNShowQueries)
|
||||
self.port.on("TMNSendEngines",TMNShowEngines)
|
||||
|
||||
|
||||
|
1
options.html
Executable file
21
package.json
Executable file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
|
||||
"preferences": [
|
||||
{
|
||||
"title": "TrackMeNot Options",
|
||||
"type": "control",
|
||||
"name": "tmnOptionPref",
|
||||
"label": "TrackMeNot Options"
|
||||
}
|
||||
],
|
||||
"name": "trackmenot",
|
||||
"fullName" : "TrackMeNot",
|
||||
"license": "GPL 2.0",
|
||||
"author": "Daniel Howe, Helen Nissenbaum, Vincent Toubiana",
|
||||
"version": "0.8.3",
|
||||
"homepage": "http://www.cs.nyu.edu/trackmenot/",
|
||||
"icon":"data/images/skin/tmn.png",
|
||||
"main": "trackmenot",
|
||||
"id": "trackmenot@mrl.nyu.edu",
|
||||
"description": "Protect against data profiling by search engines"
|
||||
}
|
37
selectcat.xul
Executable file
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<!DOCTYPE overlay SYSTEM "chrome://trackmenot/locale/trackmenot.dtd">
|
||||
<page id="topicwindow"
|
||||
onload="TRACKMENOT.editor._onSelectTopicLoad()"
|
||||
title="Select a Topic"
|
||||
width="400"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script src="chrome://trackmenot/content/utils.js" />
|
||||
<script src="chrome://trackmenot/content/editor.js" />
|
||||
<script src="chrome://trackmenot/content/tmn_feed.js" />
|
||||
|
||||
|
||||
<vbox flex="1">
|
||||
<hbox height="20">
|
||||
<description style="font-size: 9pt;">Category</description>
|
||||
</hbox>
|
||||
<hbox height="20">
|
||||
<description style="font-size: 9pt;" id="feeduri" />
|
||||
</hbox>
|
||||
<hbox flex="1">
|
||||
<vbox width="180" flex="1">
|
||||
<tree id="tree-rss" flex="1" width="180" >
|
||||
<treecols >
|
||||
<treecol id="text" label="Category Name" width="200" primary="true" flex="1" />
|
||||
</treecols>
|
||||
|
||||
</tree>
|
||||
</vbox>
|
||||
<vbox flex="1" width="20">
|
||||
<button id="valid-cat" label="OK" size="20" oncommand="TRACKMENOT.editor._addFlowToTopic();window.close();" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</page>
|
1
stoping-script.js
Executable file
|
@ -0,0 +1 @@
|
|||
self.port.on("TMNStopLoading", function() { window.back()} )
|
116
style.css
Executable file
|
@ -0,0 +1,116 @@
|
|||
.linkList {
|
||||
color: #006ec4;
|
||||
text-decoration: none;
|
||||
font-family: Verdana;
|
||||
font-weight: bold;
|
||||
font-size: 11.5px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.optiontable, .optiontable TD
|
||||
{
|
||||
font-family:verdana;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
a:link, a:visited {
|
||||
color: #006ec4;
|
||||
text-decoration: none;
|
||||
font-family: Verdana;
|
||||
font-weight: bold;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
a:link.linkperso {
|
||||
color: #413F3F;
|
||||
text-decoration: none;
|
||||
font-family: Verdana;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.linkperso:visited {
|
||||
color: #413F3F;
|
||||
text-decoration: none;
|
||||
font-family: Verdana;
|
||||
font-size: 10px;
|
||||
}
|
||||
.smLink {
|
||||
color: #006ec4;
|
||||
text-decoration: none;
|
||||
font-family: Verdana;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.lgLink {
|
||||
color: #006ec4;
|
||||
text-decoration: none;
|
||||
font-family: Verdana;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.smallbutton {
|
||||
background: #E6EAE2;
|
||||
width: 15px;
|
||||
padding:1px 0;
|
||||
border:1px solid #608925;
|
||||
font-size: 11px;
|
||||
text-align:center;
|
||||
color:#00446D;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
opacity:.85;
|
||||
}
|
||||
|
||||
|
||||
A:hover {
|
||||
color: #ff5500;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
table {
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
#tmn-table-header{
|
||||
padding:1px 0;
|
||||
border:1px solid #608925;
|
||||
|
||||
border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius:2px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
button, button:visited {
|
||||
display:block;
|
||||
background: #E6EAE2;
|
||||
width: 90px;
|
||||
padding:1px 0;
|
||||
border:1px solid #608925;
|
||||
font-size: 11px;
|
||||
text-align:center;
|
||||
color:#00446D;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
text-decoration: none;
|
||||
opacity:.85;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
border-color:#49671d;
|
||||
}
|
||||
|
||||
button:active {
|
||||
padding:2px 0 ;
|
||||
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
|
||||
DIV.block {text-align:justify}
|
13
tmn_feed.html
Executable file
|
@ -0,0 +1,13 @@
|
|||
|
||||
<html>
|
||||
<head>
|
||||
<title>TrackMeNot</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" href="chrome://trackmenot/skin/overlay.css" type="text/css">
|
||||
<link rel="icon" type="image/png" href="chrome://trackmenot/skin/tmn_icon.png" />
|
||||
<script type="application/x-javascript" src="chrome://trackmenot/content/editor.js"></script>
|
||||
</head>
|
||||
<body onload="TRACKMENOT.editor._onFeedPageLoad();">
|
||||
|
||||
</body>
|
||||
</html>
|
57
tmn_menu.html
Executable file
|
@ -0,0 +1,57 @@
|
|||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<link href="style.css" rel="stylesheet">
|
||||
<html>
|
||||
<style>
|
||||
body {
|
||||
min-width:257px;
|
||||
max-width:257px;
|
||||
max-width:157px;
|
||||
overflow-x:hidden;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<table>
|
||||
<!--<tr>
|
||||
<td>
|
||||
<hbox>
|
||||
<img width='16' height='16' src="images/skin/tmn.png" />
|
||||
<label valign=center id="trackmenot-label" cropt=right>
|
||||
</hbox>
|
||||
</td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td>
|
||||
<hbox>
|
||||
<img width='16' height='16' id="trackmenot-img-enabled" src="images/skin/on_icon.png" />
|
||||
<label id="trackmenot-enabled" >
|
||||
</hbox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td>
|
||||
<hbox >
|
||||
<img width='16' height='16' src="images/skin/option_icon.png" />
|
||||
<label data-l10n-id="tmn.menu.options" id="trackmenot-menu-win" > </label>
|
||||
</hbox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td>
|
||||
<hbox >
|
||||
<img width='16' height='16' src="images/skin/help_icon.png" />
|
||||
<label data-l10n-id="tmn.menu.help" id="trackmenot-menu-help" > </label>
|
||||
</hbox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label id="trackmenot-menu-useTab" >
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
1
tmn_page.html
Executable file
|
@ -0,0 +1 @@
|
|||
<TITLE>TrackMeNot</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META name="description" content="TrackMeNot Home">
<META name="revisit-after" content="1 days">
<META name="language" content="en">
<META name="author" content="Daniel C. Howe">
<META name="page-topic" content="TrackMeNot">
<META name="page-type" content="TrackMeNot">
<META name="audience" content="All">
<META name="robots" content="INDEX,FOLLOW">
<META name="keywords" content="trackmenot, download, firefox, extensions, values in design, extension, privacy, surveillance, security, search, daniel, daniel howe, daniel c. howe, daniel c howe, howe, canazon, helen, nissenbaum, helen nissenbaum, hfn1, mrl, nyu, values, design, applet, media research lab">
<!--script src="install.js" type="text/javascript"></script-->
<style type="text/css">
.linkList {
color: #006ec4;
text-decoration: none;
font-family: Verdana;
font-weight: bold;
font-size: 11.5px;
line-height: 22px;
}
.link {
color: #006ec4;
text-decoration: none;
font-family: Verdana;
font-weight: bold;
font-size: 12px;
}
.smLink {
color: #006ec4;
text-decoration: none;
font-family: Verdana;
font-size: 10px;
font-weight: bold;
}
.lgLink {
color: #006ec4;
text-decoration: none;
font-family: Verdana;
font-size: 13px;
font-weight: bold;
}
A:hover {
color: #ff5500;
text-decoration: none;
}
DIV.block {text-align:justify}
</style>
<script src='trackmenot.js'></script>
</head>
<body >
<div id="frame-container" > </div>
<script>
TRACKMENOT.TMNSearch.startTMN();
</script>
</body>
</html>
|
470
tmn_search.js
Executable file
|
@ -0,0 +1,470 @@
|
|||
/*******************************************************************************
|
||||
This file is part of TrackMeNot (Chrome version).
|
||||
|
||||
TrackMeNot is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, version 2 of the License.
|
||||
|
||||
TrackMeNot is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
||||
********************************************************************************/
|
||||
|
||||
if(!TRACKMENOT) var TRACKMENOT = {};
|
||||
|
||||
|
||||
TRACKMENOT.TMNInjected = function() {
|
||||
var debug_script = true;
|
||||
|
||||
var tmn =null;
|
||||
var tmn_id = 0;
|
||||
var tmnCurrentURL = '';
|
||||
var engine = '';
|
||||
// var allEvents = ['blur','change','click','dblclick','DOMMouseScroll','focus','keydown','keypress','keyup','load','mousedown','mousemove','mouseout','mouseover','mouseup','select'];
|
||||
|
||||
function roll(min,max){
|
||||
return Math.floor(Math.random()*(max+1))+min;
|
||||
}
|
||||
function trim(s) {
|
||||
return s.replace(/\n/g,'');
|
||||
}
|
||||
function cout (msg) {
|
||||
console.log(msg);
|
||||
}
|
||||
function debug (msg) {
|
||||
if (debug_script)
|
||||
console.log("Debug: "+msg);
|
||||
}
|
||||
|
||||
function getEngineById( id) {
|
||||
return engines.filter(function(a) {return a.id ==id})[0]
|
||||
}
|
||||
|
||||
function stripPhrases(htmlStr) {
|
||||
var reg = /(<b>(.+)<\/b>)/mig;
|
||||
var strip = reg.exec(htmlStr);
|
||||
return strip[0];
|
||||
}
|
||||
|
||||
function stripTags(htmlStr) {
|
||||
return htmlStr.replace(/(<([^>]+)>)/ig,"");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function pressEnter(elt) {
|
||||
var timers = getTimingArray();
|
||||
var evtDown = document.createEvent("KeyboardEvent");
|
||||
evtDown.initKeyEvent( "keydown", true, true, unsafeWindow, false, false, false, false, 13, 0 );
|
||||
window.setTimeout(function(){
|
||||
elt.dispatchEvent(evtDown);
|
||||
},timers[0])
|
||||
var evtPress= document.createEvent("KeyboardEvent");
|
||||
evtPress.initKeyEvent( "keypress", true, true, unsafeWindow, false, false, false, false, 13, 0 );
|
||||
window.setTimeout(function(){
|
||||
elt.dispatchEvent(evtPress);
|
||||
},timers[1])
|
||||
var evtUp = document.createEvent("KeyboardEvent");
|
||||
evtUp.initKeyEvent( "keyup", true, true, unsafeWindow, false, false, false, false, 13, 0 );
|
||||
window.setTimeout(function(){
|
||||
elt.dispatchEvent(evtUp);
|
||||
},timers[2])
|
||||
window.setTimeout(sendPageLoaded,timers[3])
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function downKey(chara, searchBox) {
|
||||
var charCode = chara[chara.length-1].charCodeAt(0)
|
||||
var evtDown = document.createEvent("KeyboardEvent");
|
||||
evtDown.initKeyEvent( "keydown", true, true, unsafeWindow, false, false, false, false, 0, charCode );
|
||||
searchBox.dispatchEvent(evtDown)
|
||||
}
|
||||
|
||||
function pressKey(chara, searchBox) {
|
||||
var charCode = chara[chara.length-1].charCodeAt(0)
|
||||
var evtPress = document.createEvent("KeyboardEvent");
|
||||
evtPress.initKeyEvent( "keypress", true, true, unsafeWindow, false, false, false, false, 0, charCode );
|
||||
searchBox.dispatchEvent(evtPress)
|
||||
}
|
||||
|
||||
function inputChar(chara, searchBox) {
|
||||
var ev = document.createEvent("Event");
|
||||
ev.initEvent("input", true, false);
|
||||
searchBox.dispatchEvent(ev);
|
||||
}
|
||||
|
||||
function releaseKey(chara, searchBox) {
|
||||
var charCode = chara[chara.length-1].charCodeAt(0)
|
||||
var evtUp = document.createEvent("KeyboardEvent");
|
||||
evtUp.initKeyEvent( "keyup", true, true, unsafeWindow, false, false, false, false, 0, charCode );
|
||||
searchBox.dispatchEvent(evtUp)
|
||||
}
|
||||
|
||||
function simulateClick( engine ) {
|
||||
|
||||
var clickIndex = roll(0,9);
|
||||
if ( !document || document == "undefined" ) return;
|
||||
var pageLinks = document.getElementsByTagName("a");
|
||||
|
||||
cout( 'There are ' + pageLinks.length + ' on the result page' );
|
||||
|
||||
var j = 0;
|
||||
for ( var i = 0; i < pageLinks.length; i++) {
|
||||
if (pageLinks[i].hasAttribute("orighref"))
|
||||
anchorLink = pageLinks[i].getAttribute("orighref");
|
||||
else
|
||||
anchorLink = pageLinks[i].getAttribute("href");
|
||||
anchorClass = pageLinks[i].getAttribute("class");
|
||||
var link = stripTags(pageLinks[i].innerHTML);
|
||||
eval (engine.testad)
|
||||
if ( testad!="undefined" && testad(anchorClass,anchorLink) ) {
|
||||
j++
|
||||
if ( j == clickIndex ) {
|
||||
var logEntry = JSON.stringify({
|
||||
'type' : 'click',
|
||||
"engine" : engine.id,
|
||||
'query' : link,
|
||||
'id':tmn_id
|
||||
});
|
||||
_log(logEntry)
|
||||
try {
|
||||
clickElt(pageLinks[i])
|
||||
debug("link clicked")
|
||||
} catch (e) {
|
||||
alert("error opening click-through request for " + e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function clickButton() {
|
||||
eval(engine.button)
|
||||
var button = getButton(document)
|
||||
clickElt(button);
|
||||
debug("send page loaded")
|
||||
sendPageLoaded();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function clickElt(elt) {
|
||||
var win = unsafeWindow;
|
||||
if ( !elt) return;
|
||||
var timers = getTimingArray();
|
||||
var evtDown = document.createEvent("MouseEvents");
|
||||
evtDown.initMouseEvent("mousedown",true,true,win,0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
window.setTimeout(function(){
|
||||
elt.dispatchEvent(evtDown);
|
||||
},timers[0])
|
||||
var evtUp = document.createEvent("MouseEvents");
|
||||
evtUp.initMouseEvent("mouseup",true, true,win,0,0,0,0,0, false, false, false, false, 0, null);
|
||||
window.setTimeout(function(){
|
||||
elt.dispatchEvent(evtUp);
|
||||
},timers[1])
|
||||
var evtCl = document.createEvent("MouseEvents");
|
||||
evtCl.initMouseEvent("click",true, true,win,0,0,0,0, 0, false, false, false, false, 0, null);
|
||||
window.setTimeout(function(){
|
||||
elt.dispatchEvent(evtCl);
|
||||
},timers[2])
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getElementsByAttrValue(dom,nodeType,attrName,nodeValue) {
|
||||
var outlines = dom.getElementsByTagName(nodeType);
|
||||
for (var i = 0; i<outlines.length;i++) {
|
||||
if (outlines[i].hasAttribute(attrName) && outlines[i].getAttribute(attrName) == nodeValue )
|
||||
return outlines[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function getElement(doc,aID){
|
||||
return (doc.getElementById) ? doc.getElementById(aID): doc.all[aID];
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getQuerySuggestion() {
|
||||
var suggestFilter = suggest_filters[engine];
|
||||
var searchTable = getElement(document,suggestFilter[0]);
|
||||
if ( !searchTable) return [];
|
||||
var sublines = searchTable.getElementsByTagName(suggestFilter[1]);
|
||||
var suggestElts = [];
|
||||
for ( var i=0; i< sublines.length; i++) {
|
||||
var line = sublines[i];
|
||||
if( suggestFilter[2](line) )
|
||||
suggestElts.push(line);
|
||||
}
|
||||
var suggestions = suggestElts.map(function(x) {
|
||||
return stripTags(x.innerHTML)
|
||||
});
|
||||
debug( 'TMN: ' +suggestions)
|
||||
return suggestElts.slice();
|
||||
}
|
||||
|
||||
|
||||
function getCommonWords(searchValue, nextQuery) {
|
||||
var searched = searchValue.split(' ');
|
||||
var tosearch = nextQuery.split(' ');
|
||||
var result = [];
|
||||
result = result.concat(searched.filter(function(x) {
|
||||
return (tosearch.indexOf(x)>=0)
|
||||
}));
|
||||
return result;
|
||||
}
|
||||
|
||||
function getTimingArray() {
|
||||
var timers = [];
|
||||
for (var i=0; i<5; i++) {
|
||||
timers.push(Math.floor(Math.random()*30))
|
||||
}
|
||||
return timers.sort();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function typeQuery( queryToSend, currIndex, searchBox, chara,isIncr ) {
|
||||
var nextPress ;
|
||||
tmnCurrentQuery = queryToSend;
|
||||
|
||||
clickElt(searchBox);
|
||||
searchBox.focus();
|
||||
if (currIndex < queryToSend.length ) {
|
||||
// var suggestElt = getQuerySuggestion(doc);
|
||||
if ( false && Math.random() < 0.02 && suggestElt.length >0 ) {
|
||||
var index_ = roll(0,suggestElt.length-1);
|
||||
selectElt(suggestElt[index_],searchBox);
|
||||
clickElt(suggestElt[index_]);
|
||||
blurElt(searchBox);
|
||||
updateStatus(searchBox.value);
|
||||
return;
|
||||
} else {
|
||||
var newWord = queryToSend.substring(currIndex).split(" ")[0];
|
||||
if ( newWord.length>1 && ( currIndex == 0 || queryToSend[currIndex-1]==" ") ) {
|
||||
cout("Checking if "+newWord + " appears in "+searchBox.value)
|
||||
if (! (searchBox.value.indexOf(newWord+" ")<0) ) {
|
||||
cout("It\s in")
|
||||
if( searchBox.value.indexOf(newWord, currIndex)>=0 ) {
|
||||
cout("We\re movine of "+ newWord.length+1 )
|
||||
searchBox.selectionEnd+= newWord.length+1;
|
||||
searchBox.selectionStart =searchBox.selectionEnd;
|
||||
}
|
||||
currIndex+= newWord.length;
|
||||
updateStatus(searchBox.value);
|
||||
nextPress = roll(50,250);
|
||||
window.setTimeout(typeQuery, nextPress, queryToSend,currIndex,searchBox,chara.slice() ,false )
|
||||
return;
|
||||
}
|
||||
}
|
||||
chara.push(queryToSend[currIndex])
|
||||
var timers = getTimingArray();
|
||||
var textvalue = queryToSend[currIndex];
|
||||
window.setTimeout( function(){
|
||||
return downKey(chara, searchBox)
|
||||
}, timers[0]);
|
||||
window.setTimeout( function(){
|
||||
return pressKey(chara, searchBox)
|
||||
}, timers[1]);
|
||||
window.setTimeout( function(){
|
||||
return inputChar(chara, searchBox)
|
||||
}, timers[2]);
|
||||
window.setTimeout( function(){
|
||||
searchBox.value += textvalue
|
||||
}, timers[3]);
|
||||
window.setTimeout( function(){
|
||||
return releaseKey( chara, searchBox)
|
||||
}, timers[4]);
|
||||
updateStatus(searchBox.value);
|
||||
currIndex++
|
||||
nextPress = roll(50,250);
|
||||
window.setTimeout(typeQuery, nextPress, queryToSend,currIndex,searchBox,chara.slice(),false )
|
||||
}
|
||||
} else {
|
||||
updateStatus(searchBox.value);
|
||||
nextPress = roll(10,30);
|
||||
if (Math.random() <0.5) window.setTimeout( clickButton, nextPress);
|
||||
else window.setTimeout(pressEnter, nextPress, searchBox)
|
||||
// window.setTimeout( sendCurrentURL, nextpress+1)
|
||||
}
|
||||
}
|
||||
|
||||
function sendCurrentURL() {
|
||||
debug("The current url is: " +window.location.href)
|
||||
var response = {
|
||||
url: window.location.href
|
||||
};
|
||||
self.port.emit("TMNUpdateURL",response);
|
||||
}
|
||||
|
||||
function queryToURL ( url, query) {
|
||||
if (Math.random() < 0.9)
|
||||
query = query.toLowerCase();
|
||||
var urlQuery = url.replace('|',query);
|
||||
urlQuery = urlQuery.replace(/ /g,'+');
|
||||
var encodedUrl = encodeURI(urlQuery);
|
||||
encodedUrl = encodedUrl.replace(/%253/g,"%3");
|
||||
|
||||
return encodedUrl;
|
||||
}
|
||||
|
||||
|
||||
function sendQuery(queryToSend, tmn_mode, url) {
|
||||
var host;
|
||||
try {
|
||||
host = window.location.host;
|
||||
} catch (ex) {
|
||||
host = "";
|
||||
}
|
||||
var reg = new RegExp(engine.host,'g')
|
||||
var encodedUrl = queryToURL(url, queryToSend)
|
||||
var logEntry = JSON.stringify({
|
||||
'type' : 'query',
|
||||
"engine" : engine.id,
|
||||
'mode' : tmn_mode,
|
||||
'query' : queryToSend,
|
||||
'id' : tmn_id
|
||||
});
|
||||
_log(logEntry)
|
||||
updateStatus(queryToSend);
|
||||
if ( host =="" || !host.match(reg) ) {
|
||||
try {
|
||||
window.location.href = encodedUrl;
|
||||
return encodedUrl;
|
||||
} catch (ex) {
|
||||
cout("Caught exception: "+ ex);
|
||||
self.port.emit("TMNSetTabUrl", {
|
||||
"url": encodedUrl
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (engine.button) eval(engine.button)
|
||||
if (engine.box) eval(engine.box)
|
||||
var searchBox = engine.box ? searchbox() : null;
|
||||
var searchButton = engine.button ? getButton() : null;
|
||||
if ( searchBox && searchButton && engine!='aol' ) {
|
||||
debug("The searchbox has been found "+searchBox )
|
||||
searchBox.value = getCommonWords(searchBox.value,queryToSend).join(' ');
|
||||
searchBox.selectionStart = 0;
|
||||
searchBox.selectionEnd = 0;
|
||||
var chara = new Array();
|
||||
typeQuery( queryToSend, 0, searchBox, chara,false );
|
||||
return null;
|
||||
} else {
|
||||
tmnCurrentURL = encodedUrl;
|
||||
debug("The searchbox can not be found " )
|
||||
try {
|
||||
window.location.href = encodedUrl;
|
||||
return encodedUrl;
|
||||
} catch (ex) {
|
||||
cout("Caught exception: "+ ex);
|
||||
self.port.emit("TMNSetTabUrl", {
|
||||
"url": encodedUrl
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function sendPageLoaded() {
|
||||
var req = {
|
||||
tmn: "pageLoaded",
|
||||
html: unsafeWindow.document.body.innerHTML
|
||||
}
|
||||
self.port.emit("TMNRequest",req);
|
||||
}
|
||||
|
||||
|
||||
function _log(msg) {
|
||||
var req = {
|
||||
tmnLog: msg
|
||||
}
|
||||
self.port.emit("TMNRequest",req);
|
||||
}
|
||||
|
||||
function updateStatus(msg) {
|
||||
var req = {
|
||||
updateStatus: msg
|
||||
}
|
||||
self.port.emit("TMNRequest",req);
|
||||
}
|
||||
|
||||
function setCurrentURLMap( eng, url ) {
|
||||
var Eng_URL = eng + "--" + url;
|
||||
var req = {
|
||||
setURLMap: Eng_URL
|
||||
}
|
||||
self.port.emit("TMNRequest",req);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setTMNCurrentURL(url) {
|
||||
tmnCurrentURL= url;
|
||||
debug("Current TMN loc: "+ tmnCurrentURL )
|
||||
var message = {
|
||||
url: tmnCurrentURL
|
||||
};
|
||||
self.port.emit("TMNUpdateURL", message);
|
||||
sendPageLoaded();
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
clickResult : function(request) {
|
||||
cout("Clicking on engine : "+request.tmn_engine )
|
||||
simulateClick(request.tmn_engine);
|
||||
},
|
||||
|
||||
|
||||
handleRequest : function(request) {
|
||||
debug("Received: "+ request.tmnQuery + " on engine: "+ request.tmnEngine + " mode: " +request.tmnMode)
|
||||
if (request.tmnQuery) {
|
||||
var tmn_query = request.tmnQuery;
|
||||
engine = request.tmnEngine;
|
||||
all_engines = request.allEngines;
|
||||
var tmn_mode = request.tmnMode;
|
||||
tmn_id = request.tmnID;
|
||||
var tmn_URLmap = request.tmnUrlMap;
|
||||
var encodedurl = sendQuery ( tmn_query, tmn_mode, tmn_URLmap );
|
||||
if (encodedurl != null) {
|
||||
debug("scheduling next set url");
|
||||
setTMNCurrentURL(encodedurl);
|
||||
}
|
||||
}
|
||||
return; // snub them.
|
||||
} ,
|
||||
|
||||
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
|
||||
self.port.on("TMNTabRequest", TRACKMENOT.TMNInjected.handleRequest );
|
||||
self.port.on("TMNClickResult", TRACKMENOT.TMNInjected.clickResult );
|
10
tmn_widget.html
Executable file
|
@ -0,0 +1,10 @@
|
|||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<link href="style.css" rel="stylesheet">
|
||||
<html>
|
||||
<body >
|
||||
<div valign="top" >
|
||||
<img src="images/skin/tmn_icon.png" id="tmn-widget-icon">
|
||||
<label id="tmn-text" style="vertical-align:top" >TackMeNot</label>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1393
trackmenot.js
Executable file
11
widget-script.js
Executable file
|
@ -0,0 +1,11 @@
|
|||
|
||||
function updateText(text) {
|
||||
document.getElementById("tmn-text").innerHTML = text
|
||||
console.log("Updating text on widget with: "+ text)
|
||||
}
|
||||
|
||||
function UpdateIcon(url) {
|
||||
document.getElementById("tmn-widget-icon").setAttribute("src",url)
|
||||
}
|
||||
self.port.on("UpdateText", updateText)
|
||||
self.port.on("UpdateIcon", UpdateIcon)
|