summaryrefslogtreecommitdiff
path: root/.config/qutebrowser/greasemonkey
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-12-27 11:24:28 -0500
committerluxagraf <sng@luxagraf.net>2023-12-27 11:24:28 -0500
commit7380bd8704baa93e56832fd1bf1bd573e6e3a2d5 (patch)
tree615ccefea9eeba73a1cba6d53c36d7f04a00b84d /.config/qutebrowser/greasemonkey
parent55776e0017aa5afff3630bf00b56d8fd5947509c (diff)
qute: added latest refinements of qutebrowser setup
Diffstat (limited to '.config/qutebrowser/greasemonkey')
-rw-r--r--.config/qutebrowser/greasemonkey/reddit.js32
-rw-r--r--.config/qutebrowser/greasemonkey/youtube.js10
2 files changed, 42 insertions, 0 deletions
diff --git a/.config/qutebrowser/greasemonkey/reddit.js b/.config/qutebrowser/greasemonkey/reddit.js
new file mode 100644
index 0000000..8ed3ebb
--- /dev/null
+++ b/.config/qutebrowser/greasemonkey/reddit.js
@@ -0,0 +1,32 @@
+// ==UserScript==
+// @name Old Reddit Redirect
+// @version 0.1.1
+// @description redirects you to old.reddit.com
+// @author github.com/richkmls
+// @match *://*.reddit.com/*
+// @exclude /^https?://[a-z]{2}\.reddit\.com/*
+// @exclude *out.reddit.com/*
+// @exclude *://*.reddit.com/gallery/*
+// @exclude *://*.reddit.com/media*
+// @run-at document-start
+// @grant none
+// ==/UserScript==
+
+// Enforce strict mode for better code quality
+'use strict';
+
+// Declare constant for current URL
+const currentUrl = window.location.href;
+
+// Declare constant for old reddit URL
+const oldRedditUrl = 'https://old.reddit.com/';
+
+// Check if the current URL does not include old.reddit.com
+if (!currentUrl.includes("old.reddit.com")) {
+
+ // Use regex literal and constant for new URL
+ const newUrl = currentUrl.replace(/^https?:\/\/(www\.)?reddit.com\//, oldRedditUrl);
+
+ // Redirect to new URL without history entry
+ window.location.replace(newUrl);
+}
diff --git a/.config/qutebrowser/greasemonkey/youtube.js b/.config/qutebrowser/greasemonkey/youtube.js
new file mode 100644
index 0000000..e753bc6
--- /dev/null
+++ b/.config/qutebrowser/greasemonkey/youtube.js
@@ -0,0 +1,10 @@
+// ==UserScript==
+// @name Youtube to Yewtube
+// @version 0.1
+// @description none
+// @author You
+// @include *youtube.com*
+// @run-at document-start
+// ==/UserScript==
+
+document.location.href=document.location.href.replace("youtube.com","yewtu.be");