From 84e4ea93e477647cf0f2f481b0c683dc24afd16f Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Wed, 20 Jul 2016 21:20:32 +0200 Subject: [PATCH] Matching group. ^^ --- data/jusfox.js | 9 +-------- index.js | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/data/jusfox.js b/data/jusfox.js index 2d05561..accbdbd 100644 --- a/data/jusfox.js +++ b/data/jusfox.js @@ -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, '$1'); $("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, - '$1'); - }); */ }; diff --git a/index.js b/index.js index 4dd1a42..0d5fedb 100644 --- a/index.js +++ b/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")] }); }