Matching group. ^^

This commit is contained in:
Klaus-Uwe Mitterer 2016-07-20 21:20:32 +02:00
parent f2d47cfc39
commit 84e4ea93e4
2 changed files with 3 additions and 9 deletions

View file

@ -1,12 +1,5 @@
if (document.body) { if (document.body) {
var replaced = $("body:not(a)").html().replace(/\S{0}§\S*\b/g, var replaced = $("body:not(a)").html().replace(/\S{0}(§\S*)\b/g,
'<a href="javascript:alert($1)">$1</a>'); '<a href="javascript:alert($1)">$1</a>');
$("body").html(replaced); $("body").html(replaced);
/* $('body, body *').contents().filter(function() {
return this.nodeType == Node.TEXT_NODE
&& this.nodeValue.indexOf('§') >= 0;
}).each(function() {
this.nodeValue = this.nodeValue.replace(/\S{0}§\S*\b/g,
'<a href="javascript:alert($1)">$1</a>');
}); */
}; };

View file

@ -4,6 +4,7 @@ require("sdk/tabs").on("ready", getLinks);
function getLinks(tab) { function getLinks(tab) {
tab.attach({ tab.attach({
contentScriptFile: self.data.url("jusfox.js") contentScriptFile: [self.data.url("jquery.js"),
self.data.url("jusfox.js")]
}); });
} }