start isolating i2pd specific parts

This commit is contained in:
eyedeekay
2024-10-04 21:37:54 -04:00
parent a0eae354e7
commit 9b8d27df4c
6 changed files with 16 additions and 115 deletions

View File

@ -69,14 +69,3 @@ function unhide(elements) {
}
});
}
//TODO: Don't hard-code this.
fetch("http://127.0.0.1:7657/themes/console/light/images/i2plogo.png")
.then((myJson) => {
var consoleLinks = document.querySelectorAll(".application-info");
unhide(consoleLinks);
})
.catch((error) => {
var consoleLinks = document.querySelectorAll(".application-info");
hide(consoleLinks);
});

View File

@ -120,6 +120,7 @@
<script src="info.js" type="text/javascript"></script>
<script src="messages.js" type="text/javascript"></script>
<script src="content.js" type="text/javascript"></script>
<script src="i2pd.js"></script>
<script src="proxyinfo.js" type="text/javascript"></script>
</body>
</html>

12
i2pd.js Normal file
View File

@ -0,0 +1,12 @@
// stuff required specifically to be compatible with i2pd
//TODO: Don't hard-code this.
fetch("http://127.0.0.1:7657/themes/console/light/images/i2plogo.png")
.then((myJson) => {
var consoleLinks = document.querySelectorAll(".application-info");
unhide(consoleLinks);
})
.catch((error) => {
var consoleLinks = document.querySelectorAll(".application-info");
hide(consoleLinks);
});

View File

@ -37,7 +37,8 @@
"browser_style": true,
"default_icon": "icons/i2plogo.png",
"default_title": "__MSG_extensionName__",
"default_popup": "window.html"
"default_popup": "window.html",
"default_area": "navbar"
},
"page_action": {
"browser_style": true,

View File

@ -1,103 +0,0 @@
{
"browser_specific_settings": {
"gecko": {
"id": "i2ppb@eyedeekay.github.io",
"strict_min_version": "91.1.0"
}
},
"permissions": [
"theme",
"alarms",
"browsingData",
"bookmarks",
"contextMenus",
"management",
"notifications",
"proxy",
"privacy",
"storage",
"webNavigation",
"webRequest",
"webRequestBlocking",
"contextualIdentities",
"cookies",
"history",
"tabs"
],
"host_permissions": ["<all_urls>"],
"manifest_version": 3,
"name": "__MSG_extensionName__",
"version": "2.7.1",
"description": "__MSG_extensionDescription__",
"homepage_url": "https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox",
"icons": {
"96": "icons/i2plogo.png"
},
"action": {
"browser_style": true,
"default_icon": "icons/i2plogo.png",
"default_title": "__MSG_extensionName__",
"default_popup": "window.html"
},
"page_action": {
"browser_style": true,
"default_title": "__MSG_toopieTLS__",
"default_icon": "icons/i2plogo.png",
"show_matches": [
"http://*.i2p/*",
"https://*.i2p/*",
"http://*.b32.i2p/*",
"https://*.b32.i2p/*"
],
"pinned": true
},
"options_ui": {
"page": "options/options.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["script.js"]
}
],
"background": {
"scripts": [
"config.js",
"torrent/common.js",
"torrent/background.js",
"i2pcontrol/i2pcontrol.js",
"host.js",
"privacy.js",
"platform.js",
"background.js",
"handler.js",
"proxy.js",
"info.js",
"home.js",
"scrub.js",
"bookmarks.js"
]
},
"protocol_handlers": [
{
"protocol": "ext+rc",
"name": "RouterConsole",
"uriTemplate": "http://127.0.0.1:7657/%s"
},
{
"protocol": "magnet",
"name": "I2PTorrent",
"uriTemplate": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent"
}
],
"default_locale": "en",
"chrome_settings_overrides": {
"homepage": "home.html"
},
"content_security_policy": {
"extension_pages": "default-src 'self' http://proxy.i2p"
},
"chrome_url_overrides": {
"newtab": "home.html"
}
}

View File

@ -155,6 +155,7 @@
<script src="irc.js"></script>
<script src="messages.js" type="text/javascript"></script>
<script crossorigin="anonymous" src="content.js"></script>
<script crossorigin="anonymous" src="i2pd.js"></script>
<script src="proxyinfo.js" type="text/javascript"></script>
<script src="torrent/popup.js"></script>
<script src="torrent/common.js"></script>