about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/assets/javascripts/services.js20
-rw-r--r--src/config.json25
2 files changed, 37 insertions, 8 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index d250e7f6..40b607b6 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -54,7 +54,10 @@ function redirect(url, type, initiator, forceRedirection) {
 
 		frontend = options[service].frontend ?? Object.keys(config.services[service].frontends)[0]
 
-		if (!regexArray(service, url, config, frontend)) continue
+		if (!regexArray(service, url, config, frontend)) {
+			frontend = null
+			continue
+		}
 
 		if (
 			initiator
@@ -86,6 +89,9 @@ function redirect(url, type, initiator, forceRedirection) {
 		}
 		return [zoom, lon, lat]
 	}
+	
+	if (!frontend) return
+
 	switch (frontend) {
 		// This is where all instance-specific code must be ran to convert the service url to one that can be understood by the frontend.
 		case "beatbump":
@@ -381,8 +387,6 @@ function redirect(url, type, initiator, forceRedirection) {
 				else return `${randomInstance}${url.pathname}${url.search}&teddit_proxy=${url.hostname}`
 			}
 			return `${randomInstance}${url.pathname}${url.search}`
-		default:
-			return `${randomInstance}${url.pathname}${url.search}`
 		case "neuters": {
 			const p = url.pathname
 			if (p.startsWith('/article/') || p.startsWith('/pf/') || p.startsWith('/arc/') || p.startsWith('/resizer/')) {
@@ -394,10 +398,15 @@ function redirect(url, type, initiator, forceRedirection) {
 			if (url.pathname.endsWith('-lyrics')) return `${randomInstance}${url.pathname}`
 		}
 		case "ruralDictionary": {
-			if (!url.pathname.endsWith('/define.php') && !url.pathname.endsWith('/random.php') && !url.pathname.endsWith('/')) return
+			if (!url.pathname.endsWith('/define.php') && !url.pathname.endsWith('/random.php') && url.pathname != '/') return
 			return `${randomInstance}${url.pathname}${url.search}`
 		}
-
+		case "anonymousOverflow": {
+			if (!url.pathname.startsWith('/questions') && url.pathname != '/') return
+			return `${randomInstance}${url.pathname}${url.search}`
+		}
+		default:
+			return `${randomInstance}${url.pathname}${url.search}`
 	}
 }
 
@@ -536,6 +545,7 @@ function initDefaults() {
 			options['neuters'] = ['https://neuters.de']
 			options['dumb'] = ['https://dm.vern.cc']
 			options['ruralDictionary'] = ['https://rd.vern.cc']
+			options['anonymousOverflow'] = ['https://code.whatever.social']
 
 			browser.storage.local.set({ options },
 				() => resolve()
diff --git a/src/config.json b/src/config.json
index 8027bf00..92d4dd3a 100644
--- a/src/config.json
+++ b/src/config.json
@@ -470,7 +470,7 @@
 				}
 			},
 			"targets": [
-				"^https?:\\/{2}(www\\.)?reuters.com\\/"
+				"^https?:\\/{2}(www\\.)?reuters\\.com\\/"
 			],
 			"name": "Paste Text",
 			"options": {
@@ -489,7 +489,7 @@
 				}
 			},
 			"targets": [
-				"^https?:\\/{2}(www\\.)?genius.com\\/"
+				"^https?:\\/{2}(www\\.)?genius\\.com\\/"
 			],
 			"name": "Genius",
 			"options": {
@@ -508,7 +508,7 @@
 				}
 			},
 			"targets": [
-				"^https?:\\/{2}(www\\.)?urbandictionary.com\\/"
+				"^https?:\\/{2}(www\\.)?urbandictionary\\.com\\/"
 			],
 			"name": "Urban Dictionary",
 			"options": {
@@ -517,6 +517,25 @@
 			"imageType": "svg",
 			"embeddable": false,
 			"url": "https://urbandictionary.com"
+		},
+		"stackOverflow": {
+			"frontends": {
+				"anonymousOverflow": {
+					"name": "AnonymousOverflow",
+					"instanceList": true,
+					"url": "https://github.com/httpjamesm/AnonymousOverflow"
+				}
+			},
+			"targets": [
+				"^https?:\\/{2}stackoverflow\\.com\\/"
+			],
+			"name": "Stack Overflow",
+			"options": {
+				"enabled": false
+			},
+			"imageType": "svg",
+			"embeddable": false,
+			"url": "https://stackoverflow.com/"
 		}
 	}
 }
\ No newline at end of file