about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2023-05-29 12:02:23 +0300
committerManeraKai <manerakai@protonmail.com>2023-05-29 12:02:23 +0300
commit7ff510a1f18a90b9865faac5f4f9006e69a5189a (patch)
tree8cf3ff63d3f6464fa2ddcca2bd666b1619980665 /src
parentAdded Redirect as a shortcut (diff)
downloadlibredirect-7ff510a1f18a90b9865faac5f4f9006e69a5189a.zip
Added Binternet https://codeberg.org/LibRedirect/browser_extension/issues/87
Diffstat (limited to 'src')
-rw-r--r--src/assets/images/pinterest-icon.svg42
-rw-r--r--src/assets/javascripts/services.js9
-rw-r--r--src/config.json24
-rw-r--r--src/pages/stylesheets/styles.css2
4 files changed, 75 insertions, 2 deletions
diff --git a/src/assets/images/pinterest-icon.svg b/src/assets/images/pinterest-icon.svg
new file mode 100644
index 00000000..87dd2040
--- /dev/null
+++ b/src/assets/images/pinterest-icon.svg
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   class="gUZ GjR U9O kVc"
+   height="32"
+   width="32"
+   viewBox="0 0 24 24"
+   aria-label="Pinterest"
+   role="img"
+   version="1.1"
+   id="svg4"
+   sodipodi:docname="pintrest-icon.svg"
+   inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs8" />
+  <sodipodi:namedview
+     id="namedview6"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:showpageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     showgrid="false"
+     inkscape:zoom="24.3125"
+     inkscape:cx="10.858612"
+     inkscape:cy="16"
+     inkscape:window-width="1888"
+     inkscape:window-height="1060"
+     inkscape:window-x="32"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg4" />
+  <path
+     d="M0 12c0 5.123 3.211 9.497 7.73 11.218-.11-.937-.227-2.482.025-3.566.217-.932 1.401-5.938 1.401-5.938s-.357-.715-.357-1.774c0-1.66.962-2.9 2.161-2.9 1.02 0 1.512.765 1.512 1.682 0 1.025-.653 2.557-.99 3.978-.281 1.189.597 2.159 1.769 2.159 2.123 0 3.756-2.239 3.756-5.471 0-2.861-2.056-4.86-4.991-4.86-3.398 0-5.393 2.549-5.393 5.184 0 1.027.395 2.127.889 2.726a.36.36 0 0 1 .083.343c-.091.378-.293 1.189-.332 1.355-.053.218-.173.265-.4.159-1.492-.694-2.424-2.875-2.424-4.627 0-3.769 2.737-7.229 7.892-7.229 4.144 0 7.365 2.953 7.365 6.899 0 4.117-2.595 7.431-6.199 7.431-1.211 0-2.348-.63-2.738-1.373 0 0-.599 2.282-.744 2.84-.282 1.084-1.064 2.456-1.549 3.235C9.584 23.815 10.77 24 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12"
+     id="path2"
+     style="fill:#e60023;fill-opacity:1" />
+</svg>
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 4621e48b..19a21420 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -574,6 +574,12 @@ function redirect(url, type, initiator, forceRedirection) {
 				}
 			}
 		}
+		case "binternet": {
+			console.log("binternet", url.href)
+			if (url.hostname == "i.pinimg.com") return `${randomInstance}/image_proxy.php?url=${url.href}`
+			if (url.href.endsWith("pinterest.com/")) return randomInstance
+			return null
+		}
 		default: {
 			return `${randomInstance}${url.pathname}${url.search}`
 		}
@@ -712,7 +718,8 @@ const defaultInstances = {
 	"tent": ['https://tent.sny.sh'],
 	"wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'],
 	"libreSpeed": ['https://librespeed.org'],
-	'jitsi': ['https://meet.jit.si', 'https://8x8.vc']
+	'jitsi': ['https://meet.jit.si', 'https://8x8.vc'],
+	'binternet': ['https://binternet.ahwx.org']
 }
 
 function initDefaults() {
diff --git a/src/config.json b/src/config.json
index 90b55f96..cd5dc5f0 100644
--- a/src/config.json
+++ b/src/config.json
@@ -347,6 +347,30 @@
 			"embeddable": false,
 			"url": "https://fandom.com"
 		},
+		"pinterest": {
+			"name": "Pinterest",
+			"frontends": {
+				"binternet": {
+					"name": "Binternet",
+					"instanceList": true,
+					"url": "https://github.com/Ahwxorg/Binternet",
+					"embeddable": true
+				}
+			},
+			"targets": [
+				"^https?:\\/{2}i\\.pinimg\\.com",
+				"^https?:\\/{2}(www\\.)?pinterest\\.com"
+			],
+			"options": {
+				"enabled": false,
+				"unsupportedUrls": "bypass",
+				"redirectType": "main_frame",
+				"frontend": "binternet"
+			},
+			"imageType": "svg",
+			"embeddable": true,
+			"url": "https://pinterest.com"
+		},
 		"lbry": {
 			"frontends": {
 				"lbryDesktop": {
diff --git a/src/pages/stylesheets/styles.css b/src/pages/stylesheets/styles.css
index 02ef9b40..875763dd 100644
--- a/src/pages/stylesheets/styles.css
+++ b/src/pages/stylesheets/styles.css
@@ -128,7 +128,7 @@ section.links {
 	flex-wrap: wrap;
 	flex-direction: column;
 	width: 300px;
-	max-height: 750px;
+	max-height: 800px;
 }
 
 section.links div {