Matching group. ^^
This commit is contained in:
parent
f2d47cfc39
commit
84e4ea93e4
2 changed files with 3 additions and 9 deletions
|
@ -1,12 +1,5 @@
|
|||
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>');
|
||||
$("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>');
|
||||
}); */
|
||||
};
|
||||
|
|
3
index.js
3
index.js
|
@ -4,6 +4,7 @@ require("sdk/tabs").on("ready", getLinks);
|
|||
|
||||
function getLinks(tab) {
|
||||
tab.attach({
|
||||
contentScriptFile: self.data.url("jusfox.js")
|
||||
contentScriptFile: [self.data.url("jquery.js"),
|
||||
self.data.url("jusfox.js")]
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue