use I2P urls, replace with clearnet URLS on clearnet pages via Javascript
This commit is contained in:
4
Makefile
4
Makefile
@ -13,7 +13,9 @@ index: README
|
|||||||
@echo "</head>" >> index.html
|
@echo "</head>" >> index.html
|
||||||
@echo "<body>" >> index.html
|
@echo "<body>" >> index.html
|
||||||
sed "s|magnetsub|[Magnet Link]($(MAGNET))|g" README.md | \
|
sed "s|magnetsub|[Magnet Link]($(MAGNET))|g" README.md | \
|
||||||
sed 's|https://github.com/eyedeekay/various-i2p-browsers/tree/master||g' | markdown | tee -a index.html
|
sed 's|https://github.com/eyedeekay/various-i2p-browsers/tree/master||g' | \
|
||||||
|
markdown | tee -a index.html
|
||||||
|
@echo " <script src=\"script.js\" type=\"text/javascript\"></script>" >> index.html
|
||||||
@echo "</body>" >> index.html
|
@echo "</body>" >> index.html
|
||||||
@echo "</html>" >> index.html
|
@echo "</html>" >> index.html
|
||||||
|
|
||||||
|
@ -92,5 +92,6 @@ them.</p>
|
|||||||
<p>Getting nervous, about to flash an up-to-date coreboot port to my netbook via
|
<p>Getting nervous, about to flash an up-to-date coreboot port to my netbook via
|
||||||
a ch341a flasher. I'm about 99% sure I'm not going to hurt anything, but who
|
a ch341a flasher. I'm about 99% sure I'm not going to hurt anything, but who
|
||||||
knows?</p>
|
knows?</p>
|
||||||
|
<script src="script.js" type="text/javascript"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
31
script.js
Normal file
31
script.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
for (var i = document.links.length; i-- > 0; ) {
|
||||||
|
console.log("hostname", document, "link:", document.links[i].href);
|
||||||
|
if (document.URL.includes(".i2p/")) {
|
||||||
|
if (document.links[i].href.includes("https://github.com/eyedeekay/"))
|
||||||
|
document.links[i].href = document.links[i].href.replace(
|
||||||
|
"https://github.com/eyedeekay/",
|
||||||
|
"http://git.idk.i2p/idk/"
|
||||||
|
);
|
||||||
|
if (document.links[i].href.includes("https://geti2p.net"))
|
||||||
|
document.links[i].href = document.links[i].href.replace(
|
||||||
|
"https://geti2p.net",
|
||||||
|
"http://i2p-projekt.i2p"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = document.links.length; i-- > 0; ) {
|
||||||
|
console.log("hostname", document, "link:", document.links[i].href);
|
||||||
|
if (document.URL.includes("github.io/")) {
|
||||||
|
if (document.links[i].href.includes("http://git.idk.i2p/idk/"))
|
||||||
|
document.links[i].href = document.links[i].href.replace(
|
||||||
|
"http://git.idk.i2p/idk/",
|
||||||
|
"https://github.com/eyedeekay/"
|
||||||
|
);
|
||||||
|
if (document.links[i].href.includes("http://i2p-projekt.i2p"))
|
||||||
|
document.links[i].href = document.links[i].href.replace(
|
||||||
|
"http://i2p-projekt.i2p",
|
||||||
|
"https://geti2p.net"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user